From: tobiasKaminsky Date: Wed, 30 Sep 2015 16:40:13 +0000 (+0200) Subject: Merge branch 'master' of github.com:owncloud/android into multiSelect X-Git-Tag: beta-20151122~11^2~2 X-Git-Url: http://git.linex4red.de/pub/Android/ownCloud.git/commitdiff_plain/36a635517b2e7c0985f33c1a532927803da4e79a?hp=8090269d557590a6d50f184006abef6c9bb7d399 Merge branch 'master' of github.com:owncloud/android into multiSelect --- diff --git a/res/layout/grid_image.xml b/res/layout/grid_image.xml index 383c6154..b6580e9f 100644 --- a/res/layout/grid_image.xml +++ b/res/layout/grid_image.xml @@ -81,6 +81,16 @@ android:layout_marginBottom="4dp" android:layout_marginRight="4dp" android:src="@drawable/ic_favorite" /> + + \ No newline at end of file diff --git a/res/layout/grid_item.xml b/res/layout/grid_item.xml index d0f3d0f1..23efe9a9 100644 --- a/res/layout/grid_item.xml +++ b/res/layout/grid_item.xml @@ -82,7 +82,16 @@ android:layout_marginRight="2dp" android:src="@drawable/ic_favorite" /> - + diff --git a/res/menu/multiple_file_actions_menu.xml b/res/menu/multiple_file_actions_menu.xml new file mode 100644 index 00000000..fce1654e --- /dev/null +++ b/res/menu/multiple_file_actions_menu.xml @@ -0,0 +1,50 @@ + + + + + + + + + diff --git a/res/values-ar/strings.xml b/res/values-ar/strings.xml index be9f464a..6a0dc8d7 100644 --- a/res/values-ar/strings.xml +++ b/res/values-ar/strings.xml @@ -182,7 +182,7 @@ المفضلة إعادة التسمية حذف - هل تريد حقاً حذف %1$s ؟ + هل تريد حقاً حذف %1$s ؟ هل ترغب في حذف %1$s و جهات الإتصال التابعة له؟ محليا فقط محليا فقط diff --git a/res/values-az/strings.xml b/res/values-az/strings.xml index ed93bc2e..75b0faca 100644 --- a/res/values-az/strings.xml +++ b/res/values-az/strings.xml @@ -184,7 +184,7 @@ Aşağıda göstərilən %5$s-də olan daxili və xarici fayl(lar) link edilmiş İstəkli Adı dəyiş Sil - Siz həqiqətən %1$s silmək istəyirsiniz? + Siz həqiqətən %1$s silmək istəyirsiniz? Siz həqiqətəndə %1$s və onun kontentini silmək istəyirsiniz? Yalnız daxili Yalnız daxili diff --git a/res/values-bg-rBG/strings.xml b/res/values-bg-rBG/strings.xml index 96334e49..e0ef8416 100644 --- a/res/values-bg-rBG/strings.xml +++ b/res/values-bg-rBG/strings.xml @@ -197,7 +197,7 @@ Любими Преименуване Премахване - Наистина ли искате да изтриете %1$s ? + Наистина ли искате да изтриете %1$s ? Наистина ли искате да премахнете %1$s и съдържанието му? Само локално Само локално diff --git a/res/values-bn-rBD/strings.xml b/res/values-bn-rBD/strings.xml index d5833d32..be8c7176 100644 --- a/res/values-bn-rBD/strings.xml +++ b/res/values-bn-rBD/strings.xml @@ -169,7 +169,7 @@ প্রিয়জন পূনঃনামকরণ অপসারণ - আপনি কি সত্যিই %1$s অপসারণ করতে চান? + আপনি কি সত্যিই %1$s অপসারণ করতে চান? আপনি কি সত্যিই %1$s এবং এর কনটেন্ট অপসারণ করতে চান? শুধুমাত্র লোকাল শুধুমাত্র লোকাল diff --git a/res/values-ca/strings.xml b/res/values-ca/strings.xml index 718efbf5..411a3838 100644 --- a/res/values-ca/strings.xml +++ b/res/values-ca/strings.xml @@ -177,7 +177,7 @@ Preferits Reanomena Elimina - Esteu segur que voleu eliminar %1$s? + Esteu segur que voleu eliminar %1$s? Estàs segur que vols esborrar %1$s i els seus continguts? Només local Només local diff --git a/res/values-cs-rCZ/strings.xml b/res/values-cs-rCZ/strings.xml index f702afa7..e9783020 100644 --- a/res/values-cs-rCZ/strings.xml +++ b/res/values-cs-rCZ/strings.xml @@ -197,11 +197,11 @@ Odebrat z oblíbených Přejmenovat Odstranit - Opravdu chcete odstranit %1$s ? + Opravdu chcete odstranit %1$s ? Opravdu chcete odstranit %1$s a jeho obsah? Pouze místní Pouze místní - Ze serveru + Ze serveru Vzdálený & místní Úspěšně odstraněno Odstranění nelze dokončit diff --git a/res/values-da/strings.xml b/res/values-da/strings.xml index 80a60320..b6b80b61 100644 --- a/res/values-da/strings.xml +++ b/res/values-da/strings.xml @@ -197,11 +197,11 @@ Fjern markering som foretrukket Omdøb Fjern - Er du sikker på at du vil fjerne %1$s ? + Er du sikker på at du vil fjerne %1$s ? Ønsker du virkelig at slette %1$s og dets indhold? Kun lokal Kun lokal - Fra server + Fra server Fjernbeliggende og lokalt Vellykket fjernelse Fjernelse kunne ikke fuldføres diff --git a/res/values-de-rCH/strings.xml b/res/values-de-rCH/strings.xml index 20392974..375303f7 100644 --- a/res/values-de-rCH/strings.xml +++ b/res/values-de-rCH/strings.xml @@ -146,7 +146,7 @@ Löschen Nur lokal Nur lokale Inhalte - Vom Server entfernen + Vom Server entfernen Lokal und auf dem Server Erfolgreich gelöscht Der Löschvorgang konnte nicht beendet werden diff --git a/res/values-de-rDE/strings.xml b/res/values-de-rDE/strings.xml index 7fe556bb..e1b85fa6 100644 --- a/res/values-de-rDE/strings.xml +++ b/res/values-de-rDE/strings.xml @@ -198,7 +198,7 @@ Nicht mehr favorisieren Umbenennen Löschen - Möchten Sie %1$s wirklich löschen? + Möchten Sie %1$s wirklich löschen? Möchten Sie wirklich %1$s und dessen Inhalte entfernen? Nur lokal Nur lokal diff --git a/res/values-de/strings.xml b/res/values-de/strings.xml index 8a34aeb3..44d12ef6 100644 --- a/res/values-de/strings.xml +++ b/res/values-de/strings.xml @@ -198,7 +198,7 @@ Favorit entfernen Umbenennen Löschen - Möchtest Du %1$s wirklich löschen? + Möchtest Du %1$s wirklich löschen? Möchtest Du wirklich %1$s und dessen Inhalte entfernen? Nur lokal Nur lokal diff --git a/res/values-el/strings.xml b/res/values-el/strings.xml index 434d5fbf..c1a73528 100644 --- a/res/values-el/strings.xml +++ b/res/values-el/strings.xml @@ -198,11 +198,11 @@ Κατάργηση από τα αγαπημένα Μετονομασία Αφαίρεση - Θέλετε στ\' αλήθεια να αφαιρέσετε το %1$s; + Θέλετε στ\' αλήθεια να αφαιρέσετε το %1$s; Θέλετε στ\' αλήθεια να διαγράψετε το %1$s και τα περιεχόμενά του; Μόνο τοπικά Μόνο τοπικά - Από το διακομιστή + Από το διακομιστή Απομακρυσμένα & τοπικά Αφαίρεση επιτυχής Η αφαίρεση απέτυχε diff --git a/res/values-en-rGB/strings.xml b/res/values-en-rGB/strings.xml index f0c7acde..ee9fc15a 100644 --- a/res/values-en-rGB/strings.xml +++ b/res/values-en-rGB/strings.xml @@ -192,7 +192,7 @@ Unfavourite Rename Remove - Do you really want to remove %1$s? + Do you really want to remove %1$s? Do you really want to remove %1$s and its contents? Local only Local only diff --git a/res/values-eo/strings.xml b/res/values-eo/strings.xml index daf7c1fe..3471045f 100644 --- a/res/values-eo/strings.xml +++ b/res/values-eo/strings.xml @@ -122,7 +122,7 @@ Nefavoratigi Alinomigi Forigi - Ĉu vi vere volas forigi %1$s? + Ĉu vi vere volas forigi %1$s? Ĉu vi vere volas forigi %1$s kaj ĝia enhavo? Nur loka Nur loka diff --git a/res/values-es-rAR/strings.xml b/res/values-es-rAR/strings.xml index f159bce2..e4903a21 100644 --- a/res/values-es-rAR/strings.xml +++ b/res/values-es-rAR/strings.xml @@ -177,7 +177,7 @@ Favorito Renombrar Borrar - ¿Realmente quieres eliminar %1$s? + ¿Realmente quieres eliminar %1$s? ¿Realmente deseas eliminar %1$s y todo su contenido? Sólo local Sólo local diff --git a/res/values-es-rCL/strings.xml b/res/values-es-rCL/strings.xml index e4288f15..3aa399c8 100644 --- a/res/values-es-rCL/strings.xml +++ b/res/values-es-rCL/strings.xml @@ -113,7 +113,7 @@ usuario o clave incorrecta Renombrar Remover - ¿Realmente desea eliminar %1$s? + ¿Realmente desea eliminar %1$s? ¿Realmente desea eliminar el archivo %1$s y su contenido? Solo local Solo local diff --git a/res/values-es/strings.xml b/res/values-es/strings.xml index 1796c4a8..4508c528 100644 --- a/res/values-es/strings.xml +++ b/res/values-es/strings.xml @@ -198,11 +198,11 @@ No-favorito Renombrar Borrar - ¿Realmente desea eliminar %1$s? + ¿Realmente desea eliminar %1$s? ¿Realmente desea eliminar %1$s y todo su contenido? Sólo local Sólo local - Desde el servidor + Desde el servidor Remoto & local Borrado correctamente El borrado no pudo ser completado diff --git a/res/values-et-rEE/strings.xml b/res/values-et-rEE/strings.xml index a4841a42..93954750 100644 --- a/res/values-et-rEE/strings.xml +++ b/res/values-et-rEE/strings.xml @@ -202,11 +202,11 @@ Allpool on loend kohalikest failidest ning serveris asuvatest failidest %5$s, mi Eemalda lemmik Nimeta ümber Eemalda - Oled sa kindel, et soovid %1$s eemaldada? + Oled sa kindel, et soovid %1$s eemaldada? Kas sa tõesti soovid eemaldada %1$s ja selle sisu? Ainult kohalik Ainult kohalik - Serverist + Serverist Kaugfail & kohalik Eemaldamine oli edukas Eemaldamine ebaõnnestus diff --git a/res/values-eu/strings.xml b/res/values-eu/strings.xml index a532d2ca..fd4172e8 100644 --- a/res/values-eu/strings.xml +++ b/res/values-eu/strings.xml @@ -177,7 +177,7 @@ Mesedez, baimendu berriz Gogokoa Berrizendatu Ezabatu - Ziur zaude %1$s ezabatu nahi duzula? + Ziur zaude %1$s ezabatu nahi duzula? Ziru zaude %1$s eta bere edukiak ezabatu nahi dituzula? Bertakoa bakarrik Bertakoa bakarrik diff --git a/res/values-fi-rFI/strings.xml b/res/values-fi-rFI/strings.xml index 41d39371..5bfc565a 100644 --- a/res/values-fi-rFI/strings.xml +++ b/res/values-fi-rFI/strings.xml @@ -189,11 +189,11 @@ Poista suosikeista Nimeä uudelleen Poista - Haluatko varmasti poistaa kohteen %1$s? + Haluatko varmasti poistaa kohteen %1$s? Haluatko varmasti poistaa kohteen %1$s ja sen sisällön? Vain paikallinen Vain paikallinen - Palvelimelta + Palvelimelta Etä ja paikallinen Poistettu onnistuneesti Poistamista ei voitu suorittaa loppuun asti diff --git a/res/values-fr/strings.xml b/res/values-fr/strings.xml index 4a4111be..f67f654e 100644 --- a/res/values-fr/strings.xml +++ b/res/values-fr/strings.xml @@ -203,11 +203,11 @@ Ci-dessous la liste des fichiers locaux, et les fichiers distants dans %5$s auxq Supprimer des favoris Renommer Supprimer - Voulez-vous vraiment supprimer %1$s ? + Voulez-vous vraiment supprimer %1$s ? Voulez-vous vraiment supprimer %1$s et son contenu ? Local seulement Local seulement - Depuis le serveur + Depuis le serveur Distant & local Suppression effectuée avec succès Suppression impossible diff --git a/res/values-gl/strings.xml b/res/values-gl/strings.xml index 51aa4a40..2a70987e 100644 --- a/res/values-gl/strings.xml +++ b/res/values-gl/strings.xml @@ -199,7 +199,7 @@ Descárgueo de aquí: %2$s Retirar de favoritos Renomear Retirar - Confirma que quere retirar %1$s? + Confirma que quere retirar %1$s? Confirma que quere retirar %1$s e o seu contido? Só local Só local diff --git a/res/values-he/strings.xml b/res/values-he/strings.xml index 1a62cc2d..a8a6cfa8 100644 --- a/res/values-he/strings.xml +++ b/res/values-he/strings.xml @@ -170,7 +170,7 @@ מועדף שינוי שם הסרה - האם באמת להסיר %1$s? + האם באמת להסיר %1$s? האם באמת להסיר %1$s ואת כל התכולה? מקומי בלבד מקומי בלבד diff --git a/res/values-hu-rHU/strings.xml b/res/values-hu-rHU/strings.xml index b8bae64c..49d398d8 100644 --- a/res/values-hu-rHU/strings.xml +++ b/res/values-hu-rHU/strings.xml @@ -167,7 +167,7 @@ Nem kedvenc Átnevezés Eltávolítás - Tényleg el akarod távolítani %1$s? + Tényleg el akarod távolítani %1$s? Tényleg el akarod távolítani a %1$s és tartalmát? Csak a helyi példány Csak a helyi példány diff --git a/res/values-id/strings.xml b/res/values-id/strings.xml index 76fa4048..3f400bc6 100644 --- a/res/values-id/strings.xml +++ b/res/values-id/strings.xml @@ -198,11 +198,11 @@ Hapus favorit Ubah nama Hapus - Apakah Anda yakin ingin menghapus %1$s? + Apakah Anda yakin ingin menghapus %1$s? Apakah Anda yakin ingin menghapus %1$s dan isinya? Lokal saja Lokal saja - Dari server + Dari server Remot & lokal Penghapusan berhasil Penghapusan gagal diff --git a/res/values-it/strings.xml b/res/values-it/strings.xml index 874bbe6f..5f241540 100644 --- a/res/values-it/strings.xml +++ b/res/values-it/strings.xml @@ -198,11 +198,11 @@ Rimuovi dai preferiti Rinomina Rimuovi - Vuoi davvero rimuovere %1$s? + Vuoi davvero rimuovere %1$s? Vuoi davvero rimuovere %1$s e il suo contenuto? Solo localmente Solo locale - Dal server + Dal server Remota e locale Rimozione effettuata con successo La rimozione non può essere completata diff --git a/res/values-ja-rJP/strings.xml b/res/values-ja-rJP/strings.xml index b51e644b..10d74054 100644 --- a/res/values-ja-rJP/strings.xml +++ b/res/values-ja-rJP/strings.xml @@ -199,7 +199,7 @@ お気に入りを解除 名前を変更 削除 - 本当に %1$s を削除しますか? + 本当に %1$s を削除しますか? 本当に %1$s およびそのコンテンツを削除してもよろしいですか? ローカルのみ ローカルのみ diff --git a/res/values-ko/strings.xml b/res/values-ko/strings.xml index d3a813ac..87a6cd1b 100644 --- a/res/values-ko/strings.xml +++ b/res/values-ko/strings.xml @@ -198,7 +198,7 @@ 책갈피 해제 이름 바꾸기 삭제 - %1$s을(를) 삭제하시겠습니까? + %1$s을(를) 삭제하시겠습니까? %1$s 및 포함된 내용을 삭제하시겠습니까? 로컬만 로컬만 diff --git a/res/values-lb/strings.xml b/res/values-lb/strings.xml index 80ccbff0..5366088a 100644 --- a/res/values-lb/strings.xml +++ b/res/values-lb/strings.xml @@ -143,7 +143,7 @@ De Server ënnerstëtzt dës Authentifizéierungsmethod net Ëmbenennen Läschen - Wëlls du %1$s wierklech läschen? + Wëlls du %1$s wierklech läschen? Wëlls du %1$s an de ganzen Inhalt wierklech läschen? Nemme lokal Nemme lokal diff --git a/res/values-lt-rLT/strings.xml b/res/values-lt-rLT/strings.xml index 9d3643f1..cd0dc50a 100644 --- a/res/values-lt-rLT/strings.xml +++ b/res/values-lt-rLT/strings.xml @@ -171,7 +171,7 @@ Mėgiamas Pervadinti Pašalinti - Ar tikrai norite pašalinti %1$s? + Ar tikrai norite pašalinti %1$s? Ar tikrai norite pašalinti %1$s ir ten esantį turinį? Tik vietiniai Tik vietiniai diff --git a/res/values-mk/strings.xml b/res/values-mk/strings.xml index 1c6f96fd..b819ebdb 100644 --- a/res/values-mk/strings.xml +++ b/res/values-mk/strings.xml @@ -190,7 +190,7 @@ Сметката сеуште не постои на овој уред Преименувај Отстрани - Дали навистина сакаш да ја отстраниш %1$s? + Дали навистина сакаш да ја отстраниш %1$s? Дали навистина сакаш да го отстранам %1$s и неговата содржина? Само локално Само локално diff --git a/res/values-nb-rNO/strings.xml b/res/values-nb-rNO/strings.xml index bbf1061f..d03a1a78 100644 --- a/res/values-nb-rNO/strings.xml +++ b/res/values-nb-rNO/strings.xml @@ -198,11 +198,11 @@ Fjern favoritt Endre navn Fjern - Vil du virkelig fjerne %1$s? + Vil du virkelig fjerne %1$s? Vil du virkelig fjerne %1$s inkludert innholdet? Kun lokalt Kun lokalt - Fra server + Fra server Ekstern & lokal Fjerning var vellykket Fjerning mislyktes diff --git a/res/values-nl/strings.xml b/res/values-nl/strings.xml index 88eef421..3ba9a0e3 100644 --- a/res/values-nl/strings.xml +++ b/res/values-nl/strings.xml @@ -201,11 +201,11 @@ Hieronder staan de lokale bestanden en de externe bestanden in %5$s waar ze naar Niet meer favoriet Hernoemen Verwijderen - Wilt u %1$s werkelijk verwijderen? + Wilt u %1$s werkelijk verwijderen? Wilt u %1$s en de inhoud ervan werkelijk verwijderen? Alleen lokaal Alleen lokaal - Van server + Van server Extern & lokaal Succesvol verwijderd Verwijdering kon niet voltooid worden diff --git a/res/values-oc/strings.xml b/res/values-oc/strings.xml index c50bc37e..f39570db 100644 --- a/res/values-oc/strings.xml +++ b/res/values-oc/strings.xml @@ -203,11 +203,11 @@ En rason d\'aquesta modificacion, totes los fichièrs mandats amb de versions an Suprimir dels favorits Renomenar Suprimir - Sètz segur que volètz suprimir %1$s ? + Sètz segur que volètz suprimir %1$s ? Sètz segur que volètz suprimir %1$s e son contengut ? Local solament Local solament - Dempuèi lo servidor + Dempuèi lo servidor Distant & local Supression efectuada amb succès Supression impossibla diff --git a/res/values-pl/strings.xml b/res/values-pl/strings.xml index 95168bdc..add7a952 100644 --- a/res/values-pl/strings.xml +++ b/res/values-pl/strings.xml @@ -198,11 +198,11 @@ Usuń z ulubionych Zmień nazwę Usuń - Czy naprawdę chcesz usunąć %1$s? + Czy naprawdę chcesz usunąć %1$s? Czy naprawdę chcesz usunąć %1$s i jego zawartość? Tylko lokalnie Tylko lokalnie - Z serwera + Z serwera Usunięto Nie można usunąć Wprowadź nową nazwę diff --git a/res/values-pt-rBR/strings.xml b/res/values-pt-rBR/strings.xml index 8102092d..f5b8aee5 100644 --- a/res/values-pt-rBR/strings.xml +++ b/res/values-pt-rBR/strings.xml @@ -198,11 +198,11 @@ Nãofavorito Renomear Remover - Você realmente deseja remover %1$s? + Você realmente deseja remover %1$s? Você realmente deseja remover %1$s e seus conteúdos? Somente local Somente local - Do servidor + Do servidor Remoto & local Removido com sucesso Erro ao remover diff --git a/res/values-pt-rPT/strings.xml b/res/values-pt-rPT/strings.xml index 628b53a1..e1698029 100644 --- a/res/values-pt-rPT/strings.xml +++ b/res/values-pt-rPT/strings.xml @@ -197,11 +197,11 @@ Retirar Favorito Renomear Remover - Tem a certeza que deseja remover %1$s ? + Tem a certeza que deseja remover %1$s ? Deseja realmente remover %1$s e o seu conteúdo? Apenas localmente Apenas localmente - Do servidor + Do servidor Remoto & local Removido com sucesso Não foi possível remover diff --git a/res/values-ro/strings.xml b/res/values-ro/strings.xml index e5399242..d2d6e3c5 100644 --- a/res/values-ro/strings.xml +++ b/res/values-ro/strings.xml @@ -198,11 +198,11 @@ Defavoritați Redenumește Elimină - Doriti sigur sa stergeti %1$s? + Doriti sigur sa stergeti %1$s? Sigur vrei să elimini %1$s și conținutul său? Doar local Doar local - De pe server + De pe server Ambele Eliminat cu succes Eliminarea nu a reușit diff --git a/res/values-ru-rRU/strings.xml b/res/values-ru-rRU/strings.xml index 6675918b..cfbee739 100644 --- a/res/values-ru-rRU/strings.xml +++ b/res/values-ru-rRU/strings.xml @@ -99,11 +99,11 @@ Обновлять файл Переименовать Удалить - Вы действительно хотите удалить %1$s? + Вы действительно хотите удалить %1$s? Вы действительно хотите удалить %1$s и все содержимое ? Только локально Только локальное содержимое - Удалить с сервера + Удалить с сервера Оба, удаленный и локальный Успешное удаление Удаление не может быть завершено diff --git a/res/values-ru/strings.xml b/res/values-ru/strings.xml index 5e4e3e36..2e5acc3a 100644 --- a/res/values-ru/strings.xml +++ b/res/values-ru/strings.xml @@ -199,7 +199,7 @@ Убрать из избранного Переименовать Удалить - Вы действительно хотите удалить %1$s? + Вы действительно хотите удалить %1$s? Вы действительно хотите удалить %1$s и его содержимое? Только локально Только локально diff --git a/res/values-sk-rSK/strings.xml b/res/values-sk-rSK/strings.xml index 66ac426c..aee2919b 100644 --- a/res/values-sk-rSK/strings.xml +++ b/res/values-sk-rSK/strings.xml @@ -198,11 +198,11 @@ Odobrať z obľúbených Premenuj Odober - Naozaj chcete odstrániť %1$s? + Naozaj chcete odstrániť %1$s? Naozaj chcete odstrániť %1$s a jeho obsah? Iba lokálne Iba lokálne - Zo servera + Zo servera Vzdialene aj lokálne Úspešne odstránené Odstránenie zlyhalo diff --git a/res/values-sl/strings.xml b/res/values-sl/strings.xml index e58ba5b7..5fef3d14 100644 --- a/res/values-sl/strings.xml +++ b/res/values-sl/strings.xml @@ -198,11 +198,11 @@ Odstrani priljubljeno Preimenuj Odstrani - Ali res želite odstraniti %1$s? + Ali res želite odstraniti %1$s? Ali res želite odstraniti %1$s skupaj s celotno vsebino? Le krajevno Le krajevno - S strežnika + S strežnika Oddaljeno & krajevno Odstranitev je uspešno končana Odstranjevanje je spodletelo diff --git a/res/values-sr/strings.xml b/res/values-sr/strings.xml index 4ed55083..8a27ce0f 100644 --- a/res/values-sr/strings.xml +++ b/res/values-sr/strings.xml @@ -198,7 +198,7 @@ Неомиљени Преименуј Уклони - Желите да уклоните %1$s? + Желите да уклоните %1$s? Желите да уклоните %1$s и њен садржај? Само локално Само локално diff --git a/res/values-sv/strings.xml b/res/values-sv/strings.xml index 5a6cdba2..e1eb0492 100644 --- a/res/values-sv/strings.xml +++ b/res/values-sv/strings.xml @@ -180,7 +180,7 @@ Avfavoritisera Byt namn Radera - Vill du verkligen ta bort %1$s? + Vill du verkligen ta bort %1$s? Vill du verkligen ta bort %1$s och dess innehåll? Endast lokalt Endast lokalt diff --git a/res/values-th-rTH/strings.xml b/res/values-th-rTH/strings.xml index 92fa673f..fffe5dc5 100644 --- a/res/values-th-rTH/strings.xml +++ b/res/values-th-rTH/strings.xml @@ -197,11 +197,11 @@ ออกจากรายการโปรด เปลี่ยนชื่อ ลบออก - คุณต้องการที่จะลบ %1$s? + คุณต้องการที่จะลบ %1$s? คุณต้องการที่จะลบ %1$s และเนื้อหาของมัน? เฉพาะต้นทางเท่านั้น เฉพาะต้นทางเท่านั้น - จากเซิฟเวอร์ + จากเซิฟเวอร์ รีโมท & ต้นทาง ลบเรียบร้อยแล้ว ไม่สามารถลบได้ diff --git a/res/values-tr/strings.xml b/res/values-tr/strings.xml index d682fe65..f9ff21c0 100644 --- a/res/values-tr/strings.xml +++ b/res/values-tr/strings.xml @@ -198,11 +198,11 @@ Favoriden kaldır Yeniden adlandır Kaldır - Gerçekten %1$s dosyasını kaldırmak istiyor musunuz? + Gerçekten %1$s dosyasını kaldırmak istiyor musunuz? Gerçekten %1$s ve içeriğini kaldırmak istediğinizden emin misiniz? Sadece yerel Sadece yerel - Sunucudan + Sunucudan Uzak ve yerel Kaldırma başarılı Kaldırma başarısız diff --git a/res/values-uk/strings.xml b/res/values-uk/strings.xml index c3bd6a09..40106889 100644 --- a/res/values-uk/strings.xml +++ b/res/values-uk/strings.xml @@ -186,7 +186,7 @@ Улюблений Перейменувати Видалити - Ви дійсно бажаєте видалити %1$s? + Ви дійсно бажаєте видалити %1$s? Ви дійсно бажаєте видалити %1$s та весь вміст? Лише локально Лише локально diff --git a/res/values-zh-rCN/strings.xml b/res/values-zh-rCN/strings.xml index ca8e51a2..e485cb18 100644 --- a/res/values-zh-rCN/strings.xml +++ b/res/values-zh-rCN/strings.xml @@ -198,11 +198,11 @@ 取消收藏 重命名 删除 - 你确定要删除 %1$s 吗? + 你确定要删除 %1$s 吗? 您确定要删除 %1$s 及其内容吗? 仅本地 仅本地 - 来自服务器 + 来自服务器 远程 & 本地 成功删除 无法完成删除 diff --git a/res/values-zh-rTW/strings.xml b/res/values-zh-rTW/strings.xml index db564b16..18e47c63 100644 --- a/res/values-zh-rTW/strings.xml +++ b/res/values-zh-rTW/strings.xml @@ -198,11 +198,11 @@ 不喜愛的 重新命名 移除 - 您真的要移除 %1$s ? + 您真的要移除 %1$s ? 您真的要移除 %1$s 與裡頭的檔案? 只有本地 只有本地 - 來自伺服器 + 來自伺服器 遠端 & 本地 成功地移除 刪除失敗 diff --git a/res/values/strings.xml b/res/values/strings.xml index 8f1aec21..ef912938 100644 --- a/res/values/strings.xml +++ b/res/values/strings.xml @@ -205,11 +205,11 @@ Unfavorite Rename Remove - "Do you really want to remove %1$s?" + "Do you really want to remove %1$s?" "Do you really want to remove %1$s and its contents?" Local only Local only - From server + From server Remote & local "Removal succeeded" "Removal failed" @@ -364,5 +364,8 @@ %1$d files %1$d files, 1 folder %1$d files, %2$d folders + Do you really want to remove selected items? + Do you really want to remove a folder and its content? + selected items diff --git a/src/com/owncloud/android/datamodel/OCFile.java b/src/com/owncloud/android/datamodel/OCFile.java index 4baf1ea5..9e77f0d1 100644 --- a/src/com/owncloud/android/datamodel/OCFile.java +++ b/src/com/owncloud/android/datamodel/OCFile.java @@ -27,17 +27,16 @@ import android.webkit.MimeTypeMap; import com.owncloud.android.lib.common.utils.Log_OC; import java.io.File; +import java.io.Serializable; import third_parties.daveKoeller.AlphanumComparator; public class OCFile implements Parcelable, Comparable { - public static final Parcelable.Creator CREATOR = new Parcelable.Creator() { - @Override + public static final Parcelable.Creator CREATOR = new Parcelable.Creator() { public OCFile createFromParcel(Parcel source) { return new OCFile(source); } - @Override public OCFile[] newArray(int size) { return new OCFile[size]; } diff --git a/src/com/owncloud/android/files/FileOperationsHelper.java b/src/com/owncloud/android/files/FileOperationsHelper.java index 22370289..55368f43 100644 --- a/src/com/owncloud/android/files/FileOperationsHelper.java +++ b/src/com/owncloud/android/files/FileOperationsHelper.java @@ -43,6 +43,8 @@ import com.owncloud.android.ui.dialog.ShareLinkToDialog; import org.apache.http.protocol.HTTP; +import java.util.ArrayList; + /** * */ @@ -205,10 +207,14 @@ public class FileOperationsHelper { } } + public void syncFiles(ArrayList files) { + for (OCFile file: files) { + syncFile(file); + } + } public void syncFile(OCFile file) { - - if (!file.isFolder()){ + if (!file.isFolder()) { Intent intent = new Intent(mFileActivity, OperationsService.class); intent.setAction(OperationsService.ACTION_SYNC_FILE); intent.putExtra(OperationsService.EXTRA_ACCOUNT, mFileActivity.getAccount()); @@ -216,7 +222,7 @@ public class FileOperationsHelper { intent.putExtra(OperationsService.EXTRA_SYNC_FILE_CONTENTS, true); mWaitingForOpId = mFileActivity.getOperationsServiceBinder().queueNewOperation(intent); mFileActivity.showLoadingDialog(); - + } else { Intent intent = new Intent(mFileActivity, OperationsService.class); intent.setAction(OperationsService.ACTION_SYNC_FOLDER); @@ -226,6 +232,12 @@ public class FileOperationsHelper { } } + public void toggleFavorites(ArrayList files, boolean isFavorite){ + for (OCFile file: files) { + toggleFavorite(file, isFavorite); + } + } + public void toggleFavorite(OCFile file, boolean isFavorite) { file.setFavorite(isFavorite); mFileActivity.getStorageManager().saveFile(file); @@ -329,7 +341,8 @@ public class FileOperationsHelper { service.putExtra(OperationsService.EXTRA_ACCOUNT, mFileActivity.getAccount()); mWaitingForOpId = mFileActivity.getOperationsServiceBinder().queueNewOperation(service); - mFileActivity.showLoadingDialog(); + // TODO Tobi loading dialog? + // mFileActivity.showLoadingDialog(); } /** diff --git a/src/com/owncloud/android/ui/activity/FileActivity.java b/src/com/owncloud/android/ui/activity/FileActivity.java index 1c21cab4..d74a4a6e 100644 --- a/src/com/owncloud/android/ui/activity/FileActivity.java +++ b/src/com/owncloud/android/ui/activity/FileActivity.java @@ -847,11 +847,15 @@ public class FileActivity extends AppCompatActivity */ public void showLoadingDialog() { // Construct dialog - LoadingDialog loading = new LoadingDialog(getResources().getString(R.string.wait_a_moment)); - FragmentManager fm = getSupportFragmentManager(); - FragmentTransaction ft = fm.beginTransaction(); - loading.show(ft, DIALOG_WAIT_TAG); - + Fragment frag = getSupportFragmentManager().findFragmentByTag(DIALOG_WAIT_TAG); + if (frag == null) { + Log_OC.d(TAG, "show loading dialog"); + LoadingDialog loading = new LoadingDialog(getResources().getString(R.string.wait_a_moment)); + FragmentManager fm = getSupportFragmentManager(); + FragmentTransaction ft = fm.beginTransaction(); + loading.show(ft, DIALOG_WAIT_TAG); + fm.executePendingTransactions(); + } } @@ -861,6 +865,7 @@ public class FileActivity extends AppCompatActivity public void dismissLoadingDialog() { Fragment frag = getSupportFragmentManager().findFragmentByTag(DIALOG_WAIT_TAG); if (frag != null) { + Log_OC.d(TAG, "dismiss loading dialog"); LoadingDialog loading = (LoadingDialog) frag; loading.dismiss(); } diff --git a/src/com/owncloud/android/ui/activity/FileDisplayActivity.java b/src/com/owncloud/android/ui/activity/FileDisplayActivity.java index 20bcdce4..cf9b29bc 100644 --- a/src/com/owncloud/android/ui/activity/FileDisplayActivity.java +++ b/src/com/owncloud/android/ui/activity/FileDisplayActivity.java @@ -26,6 +26,7 @@ import android.accounts.Account; import android.accounts.AccountManager; import android.accounts.AuthenticatorException; import android.annotation.TargetApi; +import android.os.Parcelable; import android.support.v7.app.AlertDialog; import android.content.BroadcastReceiver; import android.content.ComponentName; @@ -107,6 +108,8 @@ import com.owncloud.android.utils.FileStorageUtils; import com.owncloud.android.utils.UriUtils; import java.io.File; +import java.util.ArrayList; +import java.util.Iterator; /** * Displays, what files the user has available in his ownCloud. @@ -764,8 +767,12 @@ public class FileDisplayActivity extends HookActivity */ private void requestMoveOperation(Intent data, int resultCode) { OCFile folderToMoveAt = (OCFile) data.getParcelableExtra(FolderPickerActivity.EXTRA_FOLDER); - OCFile targetFile = (OCFile) data.getParcelableExtra(FolderPickerActivity.EXTRA_FILE); - getFileOperationsHelper().moveFile(folderToMoveAt, targetFile); + + ArrayList files = data.getParcelableArrayListExtra(FolderPickerActivity.EXTRA_FILES); + + for (Parcelable file : files) { + getFileOperationsHelper().moveFile(folderToMoveAt, (OCFile) file); + } } /** @@ -776,8 +783,12 @@ public class FileDisplayActivity extends HookActivity */ private void requestCopyOperation(Intent data, int resultCode) { OCFile folderToMoveAt = data.getParcelableExtra(FolderPickerActivity.EXTRA_FOLDER); - OCFile targetFile = data.getParcelableExtra(FolderPickerActivity.EXTRA_FILE); - getFileOperationsHelper().copyFile(folderToMoveAt, targetFile); + + ArrayList files = data.getParcelableArrayListExtra(FolderPickerActivity.EXTRA_FILES); + + for (Parcelable file : files) { + getFileOperationsHelper().copyFile(folderToMoveAt, (OCFile) file); + } } @Override diff --git a/src/com/owncloud/android/ui/activity/FolderPickerActivity.java b/src/com/owncloud/android/ui/activity/FolderPickerActivity.java index 4b558f00..56daee72 100644 --- a/src/com/owncloud/android/ui/activity/FolderPickerActivity.java +++ b/src/com/owncloud/android/ui/activity/FolderPickerActivity.java @@ -62,6 +62,8 @@ import com.owncloud.android.ui.fragment.FileFragment; import com.owncloud.android.ui.fragment.OCFileListFragment; import com.owncloud.android.utils.ErrorMessageAdapter; +import java.util.ArrayList; + public class FolderPickerActivity extends FileActivity implements FileFragment.ContainerActivity, OnClickListener, OnEnforceableRefreshListener { @@ -69,6 +71,8 @@ public class FolderPickerActivity extends FileActivity implements FileFragment.C + ".EXTRA_FOLDER"; public static final String EXTRA_FILE = UploadFilesActivity.class.getCanonicalName() + ".EXTRA_FILE"; + public static final String EXTRA_FILES = UploadFilesActivity.class.getCanonicalName() + + ".EXTRA_FILES"; //TODO: Think something better private SyncBroadcastReceiver mSyncBroadcastReceiver; @@ -373,12 +377,16 @@ public class FolderPickerActivity extends FileActivity implements FileFragment.C } else if (v == mChooseBtn) { Intent i = getIntent(); Parcelable targetFile = i.getParcelableExtra(FolderPickerActivity.EXTRA_FILE); + ArrayList targetFiles = i.getParcelableArrayListExtra(FolderPickerActivity.EXTRA_FILES); Intent data = new Intent(); data.putExtra(EXTRA_FOLDER, getCurrentFolder()); if (targetFile != null) { data.putExtra(EXTRA_FILE, targetFile); } + if (targetFiles != null){ + data.putParcelableArrayListExtra(EXTRA_FILES, targetFiles); + } setResult(RESULT_OK, data); finish(); } diff --git a/src/com/owncloud/android/ui/adapter/FileListListAdapter.java b/src/com/owncloud/android/ui/adapter/FileListListAdapter.java index 5e94e0f2..272a7ffc 100644 --- a/src/com/owncloud/android/ui/adapter/FileListListAdapter.java +++ b/src/com/owncloud/android/ui/adapter/FileListListAdapter.java @@ -25,12 +25,16 @@ package com.owncloud.android.ui.adapter; import java.io.File; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.Map; import java.util.Vector; import android.accounts.Account; import android.content.Context; import android.content.SharedPreferences; import android.graphics.Bitmap; +import android.graphics.Color; import android.os.Build; import android.preference.PreferenceManager; import android.text.format.DateUtils; @@ -79,6 +83,8 @@ public class FileListListAdapter extends BaseAdapter implements ListAdapter { private enum ViewType {LIST_ITEM, GRID_IMAGE, GRID_ITEM }; private SharedPreferences mAppPreferences; + + private HashMap mSelection = new HashMap(); public FileListListAdapter( boolean justFolders, @@ -195,32 +201,32 @@ public class FileListListAdapter extends BaseAdapter implements ListAdapter { case LIST_ITEM: TextView fileSizeV = (TextView) view.findViewById(R.id.file_size); TextView lastModV = (TextView) view.findViewById(R.id.last_mod); - ImageView checkBoxV = (ImageView) view.findViewById(R.id.custom_checkbox); + lastModV.setVisibility(View.VISIBLE); lastModV.setText(showRelativeTimestamp(file)); - checkBoxV.setVisibility(View.GONE); + fileSizeV.setVisibility(View.VISIBLE); fileSizeV.setText(DisplayUtils.bytesToHumanReadable(file.getFileLength())); if (!file.isFolder()) { - AbsListView parentList = (AbsListView)parent; - if (android.os.Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) { - if (parentList.getChoiceMode() == AbsListView.CHOICE_MODE_NONE) { - checkBoxV.setVisibility(View.GONE); - } else { - if (parentList.isItemChecked(position)) { - checkBoxV.setImageResource( - android.R.drawable.checkbox_on_background); - } else { - checkBoxV.setImageResource( - android.R.drawable.checkbox_off_background); - } - checkBoxV.setVisibility(View.VISIBLE); - } - } +// AbsListView parentList = (AbsListView)parent; +// if (android.os.Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) { +// if (parentList.getChoiceMode() == AbsListView.CHOICE_MODE_NONE) { +// checkBoxV.setVisibility(View.GONE); +// } else { +// if (parentList.isItemChecked(position)) { +// checkBoxV.setImageResource( +// android.R.drawable.checkbox_on_background); +// } else { +// checkBoxV.setImageResource( +// android.R.drawable.checkbox_off_background); +// } +// checkBoxV.setVisibility(View.VISIBLE); +// } +// } } else { //Folder fileSizeV.setVisibility(View.INVISIBLE); @@ -282,6 +288,25 @@ public class FileListListAdapter extends BaseAdapter implements ListAdapter { break; } + + ImageView checkBoxV = (ImageView) view.findViewById(R.id.custom_checkbox); + checkBoxV.setVisibility(View.GONE); + + AbsListView parentList = (AbsListView)parent; + if (android.os.Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) { + if (parentList.getChoiceMode() == AbsListView.CHOICE_MODE_NONE) { + checkBoxV.setVisibility(View.GONE); + } else if (parentList.getCheckedItemCount() > 0){ + if (parentList.isItemChecked(position)) { + checkBoxV.setImageResource( + android.R.drawable.checkbox_on_background); + } else { + checkBoxV.setImageResource( + android.R.drawable.checkbox_off_background); + } + checkBoxV.setVisibility(View.VISIBLE); + } + } // For all Views @@ -342,6 +367,12 @@ public class FileListListAdapter extends BaseAdapter implements ListAdapter { } } + if (mSelection.get(position) != null) { + view.setBackgroundColor(Color.rgb(248, 248, 248)); + } else { + view.setBackgroundColor(Color.WHITE); + } + return view; } @@ -487,4 +518,41 @@ public class FileListListAdapter extends BaseAdapter implements ListAdapter { public void setGridMode(boolean gridMode) { mGridMode = gridMode; } + + public void setNewSelection(int position, boolean checked) { + mSelection.put(position, checked); + notifyDataSetChanged(); + } + + public void removeSelection(int position) { + mSelection.remove(position); + notifyDataSetChanged(); + } + + public void removeSelection(){ + mSelection.clear(); + notifyDataSetChanged(); + } + + public ArrayList getCheckedItemPositions() { + ArrayList ids = new ArrayList(); + + for (Map.Entry entry : mSelection.entrySet()){ + if (entry.getValue()){ + ids.add(entry.getKey()); + } + } + return ids; + } + + public ArrayList getCheckedItems() { + ArrayList files = new ArrayList(); + + for (Map.Entry entry : mSelection.entrySet()){ + if (entry.getValue()){ + files.add((OCFile) getItem(entry.getKey())); + } + } + return files; + } } diff --git a/src/com/owncloud/android/ui/dialog/AccountActionsDialogFragment.java b/src/com/owncloud/android/ui/dialog/AccountActionsDialogFragment.java index 96414a02..e8289d01 100644 --- a/src/com/owncloud/android/ui/dialog/AccountActionsDialogFragment.java +++ b/src/com/owncloud/android/ui/dialog/AccountActionsDialogFragment.java @@ -39,6 +39,7 @@ public class AccountActionsDialogFragment extends DialogFragment implements * Listener interface for the file action fragment. */ public interface FileActionsDialogFragmentListener { + // TODO Tobi change to int array? public boolean onFileActionChosen(int menuId, int filePosition); } diff --git a/src/com/owncloud/android/ui/dialog/RemoveFileDialogFragment.java b/src/com/owncloud/android/ui/dialog/RemoveFileDialogFragment.java index 28419e62..5b92b96d 100644 --- a/src/com/owncloud/android/ui/dialog/RemoveFileDialogFragment.java +++ b/src/com/owncloud/android/ui/dialog/RemoveFileDialogFragment.java @@ -53,9 +53,9 @@ implements ConfirmationDialogFragmentListener { RemoveFileDialogFragment frag = new RemoveFileDialogFragment(); Bundle args = new Bundle(); - int messageStringId = R.string.confirmation_remove_alert; + int messageStringId = R.string.confirmation_remove_file_alert; - int posBtn = R.string.confirmation_remove_remote; + int posBtn = R.string.confirmation_remove_file_remote; int negBtn = -1; if (file.isFolder()) { messageStringId = R.string.confirmation_remove_folder_alert; diff --git a/src/com/owncloud/android/ui/dialog/RemoveFilesDialogFragment.java b/src/com/owncloud/android/ui/dialog/RemoveFilesDialogFragment.java new file mode 100644 index 00000000..6f7a159a --- /dev/null +++ b/src/com/owncloud/android/ui/dialog/RemoveFilesDialogFragment.java @@ -0,0 +1,160 @@ +/** + * ownCloud Android client application + * + * @author David A. Velasco + * Copyright (C) 2015 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 . + * + */ + +package com.owncloud.android.ui.dialog; + +/** + * Dialog requiring confirmation before removing a given OCFile. + * + * Triggers the removal according to the user response. + */ + +import android.app.Dialog; +import android.content.res.Resources; +import android.os.Bundle; + +import com.owncloud.android.MainApp; +import com.owncloud.android.R; +import com.owncloud.android.datamodel.FileDataStorageManager; +import com.owncloud.android.datamodel.OCFile; +import com.owncloud.android.ui.activity.ComponentsGetter; +import com.owncloud.android.ui.dialog.ConfirmationDialogFragment.ConfirmationDialogFragmentListener; + +import java.util.ArrayList; +import java.util.Vector; + +public class RemoveFilesDialogFragment extends ConfirmationDialogFragment +implements ConfirmationDialogFragmentListener { + + private ArrayList mTargetFiles; + + private static final String ARG_TARGET_FILES = "TARGET_FILES"; + + /** + * Public factory method to create new RemoveFileDialogFragment instances. + * + * @param files Files to remove. + * @return Dialog ready to show. + */ + public static RemoveFilesDialogFragment newInstance(ArrayList files) { + RemoveFilesDialogFragment frag = new RemoveFilesDialogFragment(); + Bundle args = new Bundle(); + + int messageStringId = R.string.confirmation_remove_files_alert; + + int posBtn = R.string.confirmation_remove_file_remote; + int negBtn = -1; + + boolean containsFolder = false; + boolean containsDown = false; + for (OCFile file: files) { + if (file.isFolder()) containsFolder = true; + if (file.isDown()) containsDown = true; + } + + if (containsFolder) { + messageStringId = R.string.confirmation_remove_folders_alert; + posBtn = R.string.confirmation_remove_remote_and_local; + negBtn = R.string.confirmation_remove_local; + } else if (containsDown) { + posBtn = R.string.confirmation_remove_remote_and_local; + negBtn = R.string.confirmation_remove_local; + } + + args.putInt(ARG_CONF_RESOURCE_ID, messageStringId); + args.putStringArray(ARG_CONF_ARGUMENTS, new String[]{MainApp.getAppContext().getString(R.string.confirmation_remove_files)}); + args.putInt(ARG_POSITIVE_BTN_RES, posBtn); + args.putInt(ARG_NEUTRAL_BTN_RES, R.string.common_no); + args.putInt(ARG_NEGATIVE_BTN_RES, negBtn); + args.putParcelableArrayList(ARG_TARGET_FILES, files); + frag.setArguments(args); + + return frag; + } + + @Override + public Dialog onCreateDialog(Bundle savedInstanceState) { + Dialog dialog = super.onCreateDialog(savedInstanceState); + mTargetFiles = getArguments().getParcelableArrayList(ARG_TARGET_FILES); + + setOnConfirmationListener(this); + + return dialog; + } + + /** + * Performs the removal of the target file, both locally and in the server. + */ + @Override + public void onConfirmation(String callerTag) { + ComponentsGetter cg = (ComponentsGetter) getActivity(); + FileDataStorageManager storageManager = cg.getStorageManager(); + for (OCFile targetFile : mTargetFiles) { + if (storageManager.getFileById(targetFile.getFileId()) != null) { + cg.getFileOperationsHelper().removeFile(targetFile, false); + } + } + } + + /** + * Performs the removal of the local copy of the target file + */ + @Override + public void onCancel(String callerTag) { + ComponentsGetter cg = (ComponentsGetter) getActivity(); + + for (OCFile targetFile : mTargetFiles) { + cg.getFileOperationsHelper().removeFile(targetFile, true); + + FileDataStorageManager storageManager = cg.getStorageManager(); + + boolean containsFavorite = false; + if (targetFile.isFolder()) { + // TODO Enable when "On Device" is recovered ? + Vector files = storageManager.getFolderContent(targetFile/*, false*/); + for (OCFile file : files) { + containsFavorite = file.isFavorite() || containsFavorite; + + if (containsFavorite) + break; + } + } + + // Remove etag for parent, if file is a favorite + // or is a folder and contains favorite + if (targetFile.isFavorite() || containsFavorite) { + OCFile folder = null; + if (targetFile.isFolder()) { + folder = targetFile; + } else { + folder = storageManager.getFileById(targetFile.getParentId()); + } + + folder.setEtag(""); + storageManager.saveFile(folder); + } + } + } + + @Override + public void onNeutral(String callerTag) { + // nothing to do here + } +} \ No newline at end of file diff --git a/src/com/owncloud/android/ui/fragment/ExtendedListFragment.java b/src/com/owncloud/android/ui/fragment/ExtendedListFragment.java index 24015d08..954b8e46 100644 --- a/src/com/owncloud/android/ui/fragment/ExtendedListFragment.java +++ b/src/com/owncloud/android/ui/fragment/ExtendedListFragment.java @@ -26,7 +26,10 @@ import android.os.Build; import android.os.Bundle; import android.support.v4.app.Fragment; import android.support.v4.widget.SwipeRefreshLayout; +import android.view.ActionMode; import android.view.LayoutInflater; +import android.view.Menu; +import android.view.MenuItem; import android.view.View; import android.view.ViewGroup; import android.widget.AbsListView; @@ -134,15 +137,61 @@ public class ExtendedListFragment extends Fragment Bundle savedInstanceState) { Log_OC.d(TAG, "onCreateView"); + // TODO Tobi remove +// AbsListView.MultiChoiceModeListener listener = new AbsListView.MultiChoiceModeListener() { +// @Override +// public void onItemCheckedStateChanged(ActionMode mode, int position, long id, boolean checked) { +// // Capture total checked items +// final int checkedCount = mListView.getCheckedItemCount(); +// // Set the CAB title according to total checked items +// mode.setTitle(checkedCount + " Selected"); +// // Calls toggleSelection method from ListViewAdapter Class +// // mAdapter.toggleSelection(position); +// +// if (checked){ +// mAdapter.setNewSelection(position,checked); +// } else { +// mAdapter.removeSelection(position); +// } +// } +// +// @Override +// public boolean onCreateActionMode(ActionMode mode, Menu menu) { +// mode.getMenuInflater().inflate(R.menu.context, menu); +// return true; +// } +// +// @Override +// public boolean onPrepareActionMode(ActionMode mode, Menu menu) { +// return false; +// } +// +// @Override +// public boolean onActionItemClicked(ActionMode mode, MenuItem item) { +// return false; +// } +// +// @Override +// public void onDestroyActionMode(ActionMode mode) { +// // mAdapter.removeSelection(); +// } +// }; + View v = inflater.inflate(R.layout.list_fragment, null); mListView = (ExtendedListView)(v.findViewById(R.id.list_root)); mListView.setOnItemClickListener(this); + mListView.setChoiceMode(ListView.CHOICE_MODE_MULTIPLE_MODAL); + // mListView.setMultiChoiceModeListener(listener); mListFooterView = inflater.inflate(R.layout.list_footer, null, false); mGridView = (GridViewWithHeaderAndFooter) (v.findViewById(R.id.grid_root)); mGridView.setNumColumns(GridView.AUTO_FIT); mGridView.setOnItemClickListener(this); + mGridView.setChoiceMode(ListView.CHOICE_MODE_MULTIPLE_MODAL); + + // mGridView.setMultiChoiceModeListener(listener); + mGridFooterView = inflater.inflate(R.layout.list_footer, null, false); if (savedInstanceState != null) { diff --git a/src/com/owncloud/android/ui/fragment/OCFileListFragment.java b/src/com/owncloud/android/ui/fragment/OCFileListFragment.java index 02bd845d..31c19cc2 100644 --- a/src/com/owncloud/android/ui/fragment/OCFileListFragment.java +++ b/src/com/owncloud/android/ui/fragment/OCFileListFragment.java @@ -26,11 +26,12 @@ import android.app.Activity; import android.content.Intent; import android.os.Bundle; import android.support.v4.widget.SwipeRefreshLayout; -import android.view.ContextMenu; +import android.view.ActionMode; import android.view.Menu; import android.view.MenuInflater; import android.view.MenuItem; import android.view.View; +import android.widget.AbsListView; import android.widget.AdapterView; import android.widget.AdapterView.AdapterContextMenuInfo; import android.widget.PopupMenu; @@ -50,6 +51,7 @@ import com.owncloud.android.ui.adapter.FileListListAdapter; import com.owncloud.android.ui.dialog.ConfirmationDialogFragment; import com.owncloud.android.ui.dialog.FileActionsDialogFragment; import com.owncloud.android.ui.dialog.RemoveFileDialogFragment; +import com.owncloud.android.ui.dialog.RemoveFilesDialogFragment; import com.owncloud.android.ui.dialog.RenameFileDialogFragment; import com.owncloud.android.ui.preview.PreviewImageFragment; import com.owncloud.android.ui.preview.PreviewMediaFragment; @@ -57,13 +59,14 @@ import com.owncloud.android.utils.FileStorageUtils; import com.owncloud.android.ui.preview.PreviewTextFragment; import java.io.File; +import java.util.ArrayList; /** * A Fragment that lists all files and folders in a given path. * * TODO refactor to get rid of direct dependency on FileDisplayActivity */ -public class OCFileListFragment extends ExtendedListFragment implements FileActionsDialogFragment.FileActionsDialogFragmentListener { +public class OCFileListFragment extends ExtendedListFragment { private static final String TAG = OCFileListFragment.class.getSimpleName(); @@ -80,11 +83,7 @@ public class OCFileListFragment extends ExtendedListFragment implements FileActi private OCFile mFile = null; private FileListListAdapter mAdapter; private boolean mJustFolders; - - private OCFile mTargetFile; - - - + /** * {@inheritDoc} */ @@ -147,16 +146,56 @@ public class OCFileListFragment extends ExtendedListFragment implements FileActi } private void registerLongClickListener() { - getListView().setOnItemLongClickListener(new AdapterView.OnItemLongClickListener() { - public boolean onItemLongClick(AdapterView arg0, View v, - int index, long arg3) { - showFileAction(index); + getListView().setMultiChoiceModeListener(new AbsListView.MultiChoiceModeListener() { + private Menu menu; + + @Override + public void onItemCheckedStateChanged(ActionMode mode, int position, long id, boolean checked) { + final int checkedCount = getListView().getCheckedItemCount(); + // TODO Tobi extract to values + mode.setTitle(checkedCount + " selected"); + + if (checked) { + mAdapter.setNewSelection(position, checked); + } else { + mAdapter.removeSelection(position); + } + + // TODO maybe change: only recreate menu if count changes + menu.clear(); + if (checkedCount == 1) { + createContextMenu(menu); + } else { + // download, move, copy, delete + getActivity().getMenuInflater().inflate(R.menu.multiple_file_actions_menu, menu); + } + + } + + @Override + public boolean onCreateActionMode(ActionMode mode, Menu menu) { + this.menu = menu; return true; } + + @Override + public boolean onPrepareActionMode(ActionMode mode, Menu menu) { + return false; + } + + @Override + public boolean onActionItemClicked(ActionMode mode, MenuItem item) { + return onFileActionChosen(item.getItemId()); + } + + @Override + public void onDestroyActionMode(ActionMode mode) { + mAdapter.removeSelection(); + } }); } - + // TODO Tobi needed? private void showFileAction(int fileIndex) { Bundle args = getArguments(); PopupMenu pm = new PopupMenu(getActivity(),null); @@ -298,17 +337,18 @@ public class OCFileListFragment extends ExtendedListFragment implements FileActi /** * {@inheritDoc} */ - @Override - public void onCreateContextMenu( - ContextMenu menu, View v, ContextMenu.ContextMenuInfo menuInfo) { + // TODO Tobi needed? + public void createContextMenu(Menu menu) { Bundle args = getArguments(); boolean allowContextualActions = (args == null) ? true : args.getBoolean(ARG_ALLOW_CONTEXTUAL_ACTIONS, true); if (allowContextualActions) { MenuInflater inflater = getActivity().getMenuInflater(); inflater.inflate(R.menu.file_actions_menu, menu); - AdapterContextMenuInfo info = (AdapterContextMenuInfo) menuInfo; - OCFile targetFile = (OCFile) mAdapter.getItem(info.position); + OCFile targetFile = null; + if (mAdapter.getCheckedItems().size() == 1){ + targetFile = mAdapter.getCheckedItems().get(0); + } if (mContainerActivity.getStorageManager() != null) { FileMenuFilter mf = new FileMenuFilter( @@ -334,86 +374,122 @@ public class OCFileListFragment extends ExtendedListFragment implements FileActi } } - /** - * {@inheritDoc} - */ - @Override - public boolean onFileActionChosen(int menuId, int filePosition) { - mTargetFile = (OCFile) mAdapter.getItem(filePosition); - switch (menuId) { - case R.id.action_share_file: { - mContainerActivity.getFileOperationsHelper().shareFileWithLink(mTargetFile); - return true; - } - case R.id.action_open_file_with: { - mContainerActivity.getFileOperationsHelper().openFile(mTargetFile); - return true; - } - case R.id.action_unshare_file: { - mContainerActivity.getFileOperationsHelper().unshareFileWithLink(mTargetFile); - return true; - } - case R.id.action_rename_file: { - RenameFileDialogFragment dialog = RenameFileDialogFragment.newInstance(mTargetFile); - dialog.show(getFragmentManager(), FileDetailFragment.FTAG_RENAME_FILE); - return true; - } - case R.id.action_remove_file: { - RemoveFileDialogFragment dialog = RemoveFileDialogFragment.newInstance(mTargetFile); - dialog.show(getFragmentManager(), ConfirmationDialogFragment.FTAG_CONFIRMATION); - return true; - } - case R.id.action_download_file: - case R.id.action_sync_file: { - mContainerActivity.getFileOperationsHelper().syncFile(mTargetFile); - return true; - } - case R.id.action_cancel_download: - case R.id.action_cancel_upload: { - ((FileDisplayActivity) mContainerActivity).cancelTransference(mTargetFile); - return true; - } - case R.id.action_see_details: { - mContainerActivity.showDetails(mTargetFile); - return true; - } - case R.id.action_send_file: { - // Obtain the file - if (!mTargetFile.isDown()) { // Download the file - Log_OC.d(TAG, mTargetFile.getRemotePath() + " : File must be downloaded"); - ((FileDisplayActivity) mContainerActivity).startDownloadForSending(mTargetFile); + public boolean onFileActionChosen(int menuId) { + if (mAdapter.getCheckedItems().size() == 1){ + OCFile mTargetFile = mAdapter.getCheckedItems().get(0); - } else { - mContainerActivity.getFileOperationsHelper().sendDownloadedFile(mTargetFile); + switch (menuId) { + case R.id.action_share_file: { + mContainerActivity.getFileOperationsHelper().shareFileWithLink(mTargetFile); + return true; } - return true; - } - case R.id.action_move: { - Intent action = new Intent(getActivity(), FolderPickerActivity.class); + case R.id.action_open_file_with: { + mContainerActivity.getFileOperationsHelper().openFile(mTargetFile); + return true; + } + case R.id.action_unshare_file: { + mContainerActivity.getFileOperationsHelper().unshareFileWithLink(mTargetFile); + return true; + } + case R.id.action_rename_file: { + RenameFileDialogFragment dialog = RenameFileDialogFragment.newInstance(mTargetFile); + dialog.show(getFragmentManager(), FileDetailFragment.FTAG_RENAME_FILE); + return true; + } + case R.id.action_remove_file: { + RemoveFileDialogFragment dialog = RemoveFileDialogFragment.newInstance(mTargetFile); + dialog.show(getFragmentManager(), ConfirmationDialogFragment.FTAG_CONFIRMATION); + return true; + } + case R.id.action_download_file: + case R.id.action_sync_file: { + mContainerActivity.getFileOperationsHelper().syncFile(mTargetFile); + return true; + } + case R.id.action_cancel_download: + case R.id.action_cancel_upload: { + ((FileDisplayActivity) mContainerActivity).cancelTransference(mTargetFile); + return true; + } + case R.id.action_see_details: { + mContainerActivity.showDetails(mTargetFile); + return true; + } + case R.id.action_send_file: { + // Obtain the file + if (!mTargetFile.isDown()) { // Download the file + Log_OC.d(TAG, mTargetFile.getRemotePath() + " : File must be downloaded"); + ((FileDisplayActivity) mContainerActivity).startDownloadForSending(mTargetFile); - // Pass mTargetFile that contains info of selected file/folder - action.putExtra(FolderPickerActivity.EXTRA_FILE, mTargetFile); - getActivity().startActivityForResult(action, FileDisplayActivity.ACTION_MOVE_FILES); - return true; - } - case R.id.action_favorite_file: { - mContainerActivity.getFileOperationsHelper().toggleFavorite(mTargetFile, true); - return true; - } - case R.id.action_unfavorite_file: { - mContainerActivity.getFileOperationsHelper().toggleFavorite(mTargetFile, false); - return true; + } else { + mContainerActivity.getFileOperationsHelper().sendDownloadedFile(mTargetFile); + } + return true; + } + case R.id.action_move: { + Intent action = new Intent(getActivity(), FolderPickerActivity.class); + ArrayList files = new ArrayList(); + files.add(mTargetFile); + action.putParcelableArrayListExtra(FolderPickerActivity.EXTRA_FILES, files); + getActivity().startActivityForResult(action, FileDisplayActivity.ACTION_MOVE_FILES); + return true; + } + case R.id.action_favorite_file: { + mContainerActivity.getFileOperationsHelper().toggleFavorite(mTargetFile, true); + return true; + } + case R.id.action_unfavorite_file: { + mContainerActivity.getFileOperationsHelper().toggleFavorite(mTargetFile, false); + return true; + } + case R.id.action_copy: + Intent action = new Intent(getActivity(), FolderPickerActivity.class); + + // Pass mTargetFile that contains info of selected file/folder + action.putExtra(FolderPickerActivity.EXTRA_FILE, mTargetFile); + getActivity().startActivityForResult(action, FileDisplayActivity.ACTION_COPY_FILES); + return true; + default: + return false; } - case R.id.action_copy: - Intent action = new Intent(getActivity(), FolderPickerActivity.class); + } else { + ArrayList mTargetFiles = mAdapter.getCheckedItems(); - // Pass mTargetFile that contains info of selected file/folder - action.putExtra(FolderPickerActivity.EXTRA_FILE, mTargetFile); - getActivity().startActivityForResult(action, FileDisplayActivity.ACTION_COPY_FILES); - return true; - default: - return false; + switch (menuId) { + case R.id.action_remove_file: { + RemoveFilesDialogFragment dialog = RemoveFilesDialogFragment.newInstance(mTargetFiles); + dialog.show(getFragmentManager(), ConfirmationDialogFragment.FTAG_CONFIRMATION); + return true; + } + case R.id.action_download_file: + case R.id.action_sync_file: { + mContainerActivity.getFileOperationsHelper().syncFiles(mTargetFiles); + return true; + } + case R.id.action_move: { + Intent action = new Intent(getActivity(), FolderPickerActivity.class); + action.putParcelableArrayListExtra(FolderPickerActivity.EXTRA_FILES, mTargetFiles); + getActivity().startActivityForResult(action, FileDisplayActivity.ACTION_MOVE_FILES); + return true; + } + case R.id.action_favorite_file: { + mContainerActivity.getFileOperationsHelper().toggleFavorites(mTargetFiles, true); + return true; + } + case R.id.action_unfavorite_file: { + mContainerActivity.getFileOperationsHelper().toggleFavorites(mTargetFiles, false); + return true; + } + case R.id.action_copy: + Intent action = new Intent(getActivity(), FolderPickerActivity.class); + action.putParcelableArrayListExtra(FolderPickerActivity.EXTRA_FILES, mTargetFiles); + getActivity().startActivityForResult(action, FileDisplayActivity.ACTION_COPY_FILES); + return true; + default: + return false; + } } + } /** @@ -422,7 +498,7 @@ public class OCFileListFragment extends ExtendedListFragment implements FileActi @Override public boolean onContextItemSelected (MenuItem item) { AdapterContextMenuInfo info = (AdapterContextMenuInfo) item.getMenuInfo(); - boolean matched = onFileActionChosen(item.getItemId(), ((AdapterContextMenuInfo) item.getMenuInfo()).position); + boolean matched = onFileActionChosen(item.getItemId()); if(!matched) { return super.onContextItemSelected(item); } else {