-language: java
+language: android
+android:
+ components:
+ - build-tools-20.0.0
+ - android-19
+ - android-17
+ - android-14
+ - extra-android-support
+ licenses:
+ - 'android-sdk-license-5be876d5'
+ - 'android-sdk-license-598b93a6'
+
jdk: oraclejdk7
+
before_install:
- # Install base Android SDK
- - sudo apt-get update -qq
- - sudo apt-get install -qq libstdc++6:i386 lib32z1 expect
- - export COMPONENTS="build-tools-20.0.0,android-14,android-17,android-19,sysimg-19,extra-android-support"
- - export LICENSES="android-sdk-license-5be876d5|android-sdk-license-598b93a6"
- - curl -3L https://raw.github.com/embarkmobile/android-sdk-installer/version-2/android-sdk-installer | bash /dev/stdin --install=$COMPONENTS --accept=$LICENSES
- - source ~/.android-sdk-installer/env
- - rm pom.xml
- - ./setup_env.sh
+ - rm pom.xml
+ - ./setup_env.sh
script:
- ant clean
along with this program. If not, see <http://www.gnu.org/licenses/>.
-->
<manifest package="com.owncloud.android"
- android:versionCode="10500800"
- android:versionName="1.5.8" xmlns:android="http://schemas.android.com/apk/res/android">
+ android:versionCode="10600000"
+ android:versionName="1.6.0" xmlns:android="http://schemas.android.com/apk/res/android">
<uses-permission android:name="android.permission.GET_ACCOUNTS" />
<uses-permission android:name="android.permission.USE_CREDENTIALS" />
-If you want to start help developing ownCloud please follow the [contribution guidelines][0] and observe these instructions:
-
-### 1. Fork and download android/develop repository:
+If you want to start help developing ownCloud please follow the [contribution guidelines][0] and observe these instructions.
-NOTE: You must have git in your environment path variable to perform the next operations.
+If you have any problems, start again with 1) and work your way down. If something still does not work as described here, please open a new issue describing exactly what you did, what happened, and what should have happened.
+### 1) Fork and download android/develop repository:
+
+NOTE: Android SDK with platforms 8, 14 and 19 (and maybe others) need to be installed.
+ You must have the Android SDK 'tools/', and 'platforms-tools/' folders in your environment path variable.
+ "git" need to be installed and in your environment path variable.
+
* Navigate to https://github.com/owncloud/android, click fork.
* Clone your new repo: "git clone git@github.com:YOURGITHUBNAME/android.git"
* Move to the project folder with "cd android"
* Make sure to get the latest changes from official android/develop branch: "git pull upstream develop"
* Complete the setup of project properties and resolve pending dependencies running "setup_env.bat" or "./setup_env.sh" .
-At this point you can continue using different tools to build the project. Section 2, 3 and 4 describe some of the existing alternatives.
+At this point you can continue using different tools to build the project. Sections 2a), 2b), and 2c) describe some of the existing alternatives.
-### 2. Building with Ant:
+### 2a) Building with Ant:
NOTE: You must have the Android SDK 'tools/', and 'platforms-tools/' folders in your environment path variable.
* Run "ant clean" .
* Run "ant debug" to generate a debuggable version of the ownCloud app.
-### 3. Building with console/maven:
+### 2b) Building with console/maven:
NOTE: You must have mvn (version >= 3.1.1) in your environment path. Current Android 'platforms-tools' need to be installed.
Now you can create ownCloud APK using "mvn package"
-### 4. Building with Eclipse:
+### 2c) Building with Eclipse:
NOTE: You must have the Android SDK 'tools/', and 'platforms-tools/' folders in your environment path variable.
* Open Eclipse and create new "Android Project from Existing Code". Choose android/actionbarsherlock/library as root.
* Clean project and compile.
* If any error appear, check the project properties; in the 'Android' section, API Level should be greater or equal than 14.
+* If "error loading libz.so.1" appears, try "sudo apt-get install lib32z1"
* Make sure android/actionbarsherlock/library/bin/library.jar was created.
-* Create a new "Android Project from Existing Code". Choose android/owncloud-android-library as root.
+* Create a new "Android Project from Existing Code". Choose android/owncloud-android-library as root. (test and sample clients are not required.)
* Clean project and compile.
* If any error appear, check the project properties; in the 'Android' section, API Level should be 19 or greater.
-* Make sure android/owncloud-android-library/bin/classes.jar was created.
+* Make sure 'android/owncloud-android-library/bin/owncloud android library.jar' was created.
* Import ownCloud Android project.
* Clean project and compile.
* If any error appears, check the project properties of owncloud-android project; in the 'Android' section:
NOTE: Even though API level is set to 19, APK also runs on older devices because in AndroidManifest.xml minSdkVersion is set to 8.
-### 5. Create pull request:
+### 3) Create pull request:
NOTE: You must sign the [Contributor Agreement][1] before your changes can be accepted!
* Again, click "Edit" and set "compare:develop"
* Enter description and send pull request.
-### 6. Create another pull request:
+### 4) Create another pull request:
To make sure your new pull request does not contain commits which are already contained in previous PRs, create a new branch which is a clone of upstream/develop.
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.owncloud.android.workaround.accounts"
- android:versionCode="0100017"
- android:versionName="1.0.17" >
+ android:versionCode="0100018"
+ android:versionName="1.0.18" >
<uses-sdk
android:minSdkVersion="16"
-Subproject commit 79d586637ee306fdbefbbc4439eb3b058f6877c9
+Subproject commit 5bd0d7387712ce3f53869294761ac4d8537841cd
along with this program. If not, see <http://www.gnu.org/licenses/>.
-->
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ android:id="@+id/fileDownloadLL"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
<?xml version="1.0" encoding="utf-8"?>
- <LinearLayout
- xmlns:android="http://schemas.android.com/apk/res/android"
- android:orientation="vertical"
- android:layout_width="match_parent"
- android:layout_height="match_parent"
- android:paddingLeft="8dp"
- android:paddingRight="8dp">
-
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:orientation="vertical"
+ android:padding="10dp"
+ android:paddingLeft="8dp"
+ android:paddingRight="8dp"
+ android:weightSum="1" >
- <ListView android:id="@android:id/list"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- />
+ <ScrollView
+ android:id="@+id/scrollView1"
+ android:layout_width="match_parent"
+ android:layout_height="0dp"
+ android:layout_marginBottom="15dp"
+ android:layout_weight="1" >
- <TextView android:id="@android:id/empty"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:background="#FF0000"
- android:text="No data"/>
- <LinearLayout
- android:orientation="vertical"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:gravity="bottom">
-
- <Button
- android:id="@+id/deleteLogHistoryButton"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:text="@string/prefs_log_delete_history_button"/>
-
- </LinearLayout>
-
- </LinearLayout>
+ <LinearLayout
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:orientation="vertical" >
+
+ <TextView
+ android:id="@+id/logTV"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:text="@string/empty" />
+ </LinearLayout>
+ </ScrollView>
+
+ <Button
+ android:id="@+id/deleteLogHistoryButton"
+ android:layout_width="match_parent"
+ android:layout_height="50dp"
+ android:text="@string/prefs_log_delete_history_button" />
+
+ <Button
+ android:id="@+id/sendLogHistoryButton"
+ android:layout_width="match_parent"
+ android:layout_height="50dp"
+ android:text="@string/log_send_history_button" />
+
+</LinearLayout>
\ No newline at end of file
android:layout_centerInParent="true"
/>
- <com.ortiz.touch.TouchImageView
+ <com.owncloud.android.utils.TouchImageViewCustom
android:id="@+id/image"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orderInCategory="2"
android:showAsAction="never"
android:title="@string/actionbar_settings"/>
+ <item
+ android:id="@+id/action_logger"
+ android:icon="@drawable/ic_action_settings"
+ android:orderInCategory="2"
+ android:showAsAction="never"
+ android:title="@string/actionbar_logger"/>
<!-- <item android:id="@+id/search" android:title="@string/actionbar_search" android:icon="@drawable/ic_action_search"></item> -->
<string name="prefs_category_accounts">حسابات</string>
<string name="saml_authentication_wrong_pass">كلمة مرور خاطئة</string>
<string name="move_choose_button_text">اختيار</string>
+ <string name="prefs_category_security">الأمان</string>
</resources>
<string name="prefs_feedback">Geriyə cavab</string>
<string name="prefs_imprint">İşarələmək</string>
<string name="recommend_subject">%1$s-i ağıllı telefonunuzda yoxlayın!</string>
+ <string name="recommend_text">Mən sizi öz smartfonunuzda %1$s istifadə etmək üçün dəvət etmək istəyirəm! Burdan endirin: %2$s</string>
<string name="auth_check_server">Serveri yoxla</string>
<string name="auth_host_url">Server ünvanı https://…</string>
<string name="auth_username">İstifadəçi adı</string>
<string name="media_state_playing">%1$s (oxuyur)</string>
<string name="media_state_loading">%1$s (yüklənir)</string>
<string name="media_event_done">%1$s geriyə oxunuş bitib</string>
+ <string name="media_err_nothing_to_play">Media faylı tapılmadı</string>
+ <string name="media_err_no_account">Heç bir hesab təqdim edilməyib</string>
+ <string name="media_err_not_in_owncloud">Fayl keçərli hesabda deyil</string>
+ <string name="media_err_unsupported">Media kodeki dəstəklənmir</string>
+ <string name="media_err_io">Media fayl oxunula bilmir</string>
+ <string name="media_err_malformed">Media fayl düzgün kodlaşdırılmayıb</string>
+ <string name="media_err_timeout">İşə salınmanın gözləmə vaxtı bitdi</string>
+ <string name="media_err_invalid_progressive_playback">Media faylı axınlı ola bilməz</string>
+ <string name="media_err_unknown">Media faylı anbarda olan media oxuyucusu ilə işlədilə bilmız</string>
+ <string name="media_err_security_ex">Oynamaya çalışarkən təhlükəsizlik xətası %1$s</string>
+ <string name="media_err_io_ex">Oynamaya çalışarkən daxiletmə xətası %1$s</string>
+ <string name="media_err_unexpected">Oynamaya çalışarkən gözlənilməyən xəta %1$s</string>
+ <string name="media_rewind_description">Geriyə qayıdış düyməsi</string>
+ <string name="media_play_pause_description">Oxunma və ya tənəffüs düyməsi</string>
+ <string name="media_forward_description">Sürətlə irəli düyməsi</string>
+ <string name="auth_getting_authorization">Yetki alınır...</string>
+ <string name="auth_trying_to_login">Girişə cəhd edilir...</string>
+ <string name="auth_no_net_conn_title">Şəbəkə qoşulması yoxdur</string>
+ <string name="auth_nossl_plain_ok_title">Təhlükəsiz qoşulma mümkün deyil.</string>
+ <string name="auth_connection_established">Əlaqə quruldu</string>
+ <string name="auth_testing_connection">Qoşulma test edilir...</string>
+ <string name="auth_not_configured_title">Yalnış qurulmuş server konfiqurasiyası</string>
+ <string name="auth_account_not_new">Avadanlıqda eyni istifadəçi və server üçün artıq hesab mövcuddur</string>
+ <string name="auth_account_not_the_same">Daxil edilən hesab bu hesabla üst-üstə düşmür</string>
+ <string name="auth_unknown_error_title">Yalnış səhv baş verdi!</string>
+ <string name="auth_unknown_host_title">Host-u tapmaq mümkün olmadı</string>
+ <string name="auth_incorrect_path_title">Server nüsxəsi tapılmadı</string>
+ <string name="auth_timeout_title">Server cavab üçün çox uzun müddət aldı</string>
+ <string name="auth_incorrect_address_title">Xətalı URL</string>
+ <string name="auth_ssl_general_error_title">SSL inisializasiyası səhvi</string>
+ <string name="auth_ssl_unverified_server_title">SSL serverin şəxsiliyini təyin etmək mümkün olmadı</string>
+ <string name="auth_bad_oc_version_title">Təyin edilməyən server versiyası</string>
+ <string name="auth_wrong_connection_title">Qoşulma yaratmaq mümkün olmadı</string>
+ <string name="auth_secure_connection">Təhlükəsiz qoşulma yaradıldı</string>
+ <string name="auth_unauthorized">Yalnış istifadəçi yada şifrə</string>
+ <string name="auth_oauth_error">Uğursuz yetkiləndirmə</string>
+ <string name="auth_oauth_error_access_denied">Yetkiləndirmə serveri tərəfindən giriş əngəlləndi</string>
+ <string name="auth_wtf_reenter_URL">Bəlli ediləbilməyən vəziyyət; xahiş olunur, serverin URL-ni yenidən daxil edəsiniz</string>
+ <string name="auth_expired_oauth_token_toast">Sizin yetinizin vaxtı bitmişdir. Xahiş olunur, yenidən yetkilənəsiniz</string>
+ <string name="auth_expired_basic_auth_toast">Xahiş olunur, hazırki şifrəni daxil edəsiniz</string>
+ <string name="auth_expired_saml_sso_token_toast">Sizin sessiyanın vaxtı bitmişdir. Xahiş olunur yenidən qoşulasınız</string>
+ <string name="auth_connecting_auth_server">Yetkiləndirmə serverinə qoşulma gedir...</string>
+ <string name="auth_unsupported_auth_method">Server bu qeydiyyat metodikasını dəstəkləmir</string>
+ <string name="auth_unsupported_multiaccount">%1$s çoxlu hesab dəstəkləmir</string>
+ <string name="auth_fail_get_user_name">Sizin server düzgün istifadəçi id-si qaytarmır, xahiş olunur inzibatçı ilə əlaqə saxlayasınız</string>
+ <string name="auth_can_not_auth_against_server">Bu serverdə yenidən qeydiyyatdan keçmək olmur</string>
+ <string name="fd_keep_in_sync">Faylı gündəmdə saxla</string>
+ <string name="common_rename">Adı dəyiş</string>
<string name="common_remove">Sil</string>
+ <string name="confirmation_remove_alert">Siz həqiqətən %1$s silmək istəyirsiniz?</string>
+ <string name="confirmation_remove_folder_alert">Siz həqiqətəndə %1$s və onun kontentini silmək istəyirsiniz?</string>
+ <string name="confirmation_remove_local">Yalnız daxili</string>
+ <string name="confirmation_remove_folder_local">Yalnız daxili kontent</string>
+ <string name="confirmation_remove_remote">Serverdən sil</string>
+ <string name="confirmation_remove_remote_and_local">Uzaq və lokal</string>
+ <string name="remove_success_msg">Silmə uğurlu oldu</string>
+ <string name="remove_fail_msg">Silmək mümkün olmadı</string>
+ <string name="rename_dialog_title">Yeni adı daxil edin</string>
+ <string name="rename_local_fail_msg">Daxili nüsxənin adı dəyişdirilə bilməz; fərqli ad yoxlayın</string>
+ <string name="rename_server_fail_msg">Ad dəyişmə bitə bilməz</string>
+ <string name="sync_file_fail_msg">Uzaq fayl yoxlanıla bilməz</string>
+ <string name="sync_file_nothing_to_do_msg">Faylın kontenti artıq sinxronizasiya edilmişdir</string>
+ <string name="create_dir_fail_msg">Qovluq yaradıla bilməz</string>
+ <string name="filename_forbidden_characters">Qadağan edilmiş simvollar: / \\ < > : \" | ? *</string>
+ <string name="filename_empty">Faylın adı boş ola bilməz</string>
+ <string name="wait_a_moment">Biraz gözləyin</string>
+ <string name="filedisplay_unexpected_bad_get_content">Naməlum problem; xahiş olunur faylı fərqli program təminatından seçəsiniz</string>
+ <string name="filedisplay_no_file_selected">Heç bir fayl seçilməyib</string>
+ <string name="activity_chooser_title">Linki yollayın ...</string>
+ <string name="oauth_check_onoff">oAuth2 ilə qeydiyyatdan keçin</string>
+ <string name="oauth_login_connection">oAuth2 serverinə qoşulur...</string>
+ <string name="ssl_validator_header">Sayta olan identifikasiya yoxlanıla bilməz</string>
+ <string name="ssl_validator_reason_cert_not_trusted">Server sertifikati inamlı deyil</string>
+ <string name="ssl_validator_reason_cert_expired">- Server sertifikatının vaxtı bitmişdir</string>
+ <string name="ssl_validator_reason_cert_not_yet_valid">- Server sertifikatının düzgün tarixi gələcəkdədir</string>
<string name="ssl_validator_btn_details_see">Detallar</string>
<string name="unshare_link_file_error">Bu fayl və ya qovluğun yayımlanmasının dayandırılmasında səhv baş verdi</string>
<string name="activity_chooser_send_file_title">Göndər</string>
<string name="downloader_download_file_not_found">Файлът вече не се намира на този сървър</string>
<string name="prefs_category_accounts">Профили</string>
<string name="prefs_add_account">Добавяне на профил</string>
- <string name="auth_redirect_non_secure_connection_title">Сигурна връзка е пренасочена по несигурен път.</string>
+ <string name="actionbar_logger">Доклади</string>
+ <string name="log_send_history_button">Изпрати История</string>
+ <string name="log_mail_subject">ownCloud Android доклади</string>
+ <string name="log_progress_dialog_text">Зареждане на информация...</string>
<string name="saml_authentication_required_text">Нужна е идентификация</string>
<string name="saml_authentication_wrong_pass">Грешна парола</string>
<string name="actionbar_move">Премести</string>
<string name="move_file_invalid_overwrite">Файлът вече съществува в отдалечената папка.</string>
<string name="move_file_error">Настъпи грешка при опита за преместване на този файл или папка.</string>
<string name="forbidden_permissions_move">за да преместиш този файл</string>
+ <string name="prefs_category_security">Сигурност</string>
</resources>
<string name="prefs_log_title">লগিং সক্রিয় কর</string>
<string name="prefs_log_summary">সমস্যা তালিকাভুক্ত করার জায়গা</string>
<string name="prefs_log_title_history">লগিং ইতিহাস </string>
- <string name="prefs_log_summary_history">রেকরডেড লগ এখানে দেখেন</string>
+ <string name="prefs_log_summary_history">রà§\87à¦\95রà§\8dডà§\87ড লà¦\97 à¦\8fà¦\96ানà§\87 দà§\87à¦\96à§\87ন</string>
<string name="prefs_log_delete_history_button">ইতিহাস ডিলিট করেন</string>
<string name="prefs_help">সহায়িকা</string>
<string name="prefs_recommend">বন্ধুর কাছে সুপারিশ করুন</string>
<string name="uploader_error_forbidden_content">এই যৌথ কনটেন্ট এ %1$s এর প্রবেশ অনুমোদিত নয়</string>
<string name="uploader_info_uploading">আপলোড করা হচ্ছে</string>
<string name="file_list_empty">এখানে কিছুই নেই। কিছু আপলোড করুন !</string>
- <string name="file_list_loading">লোড হচছে....</string>
+ <string name="file_list_loading">লà§\87াড হà¦\9aà§\8dà¦\9bà§\87....</string>
<string name="local_file_list_empty">এই ফোলডারে কোন ফাইল নেই</string>
<string name="filedetails_select_file">অতিরিক্ত তথ্য প্রদর্শন করতে চাইলে ফাইলে ট্যাপ দিন</string>
<string name="filedetails_size">আয়তনঃ</string>
<string name="media_forward_description">আগান</string>
<string name="auth_getting_authorization">অনুমোদন নেয়া হচ্ছে....</string>
<string name="auth_trying_to_login">লগইনের চেষটা চলছে..</string>
- <string name="auth_no_net_conn_title">নà§\87à¦\9fà¦\93à§\9fারà¦\95 à¦\95ানà§\87à¦\95শন নেই</string>
+ <string name="auth_no_net_conn_title">নà§\87à¦\9fà¦\93à§\9fারà§\8dà¦\95 সà¦\82যà§\8bà¦\97 নেই</string>
<string name="auth_nossl_plain_ok_title">নিরাপদ যোগাযোগ পাওয়া গেলনা</string>
<string name="auth_connection_established">যোগাযোগ স্থাপিত হয়েছে</string>
<string name="auth_testing_connection">যোগাযোগ পরীক্ষা করা হচ্ছে...</string>
<string name="conflict_message">স্থানীয় ফাইল আর দুরবর্তী ফাইল %s এক নয়। এগোতে চাইলে সার্ভারের ফাইলের কনটেন্ট প্রদিস্থাপিত হবে।</string>
<string name="conflict_keep_both">উভয়কে রাখ</string>
<string name="conflict_overwrite">উপরে লেখ</string>
- <string name="conflict_dont_upload">আপলোড করোনা</string>
+ <string name="conflict_dont_upload">à¦\86পলà§\8bড à¦\95à§\8bরà§\8bনা</string>
<string name="preview_image_description">ছবি প্রাকদর্শন</string>
<string name="preview_image_error_unknown_format">ছবিটি প্রদর্শন করা যাবেনা</string>
<string name="error__upload__local_file_not_copied">%1$s কে %2$s স্থানীয় ফোল্ডারে কপি করা গেলনা </string>
<string name="downloader_download_file_not_found">সার্ভারে এই ফাইলটি আর প্রাপ্তব্য নয়</string>
<string name="prefs_category_accounts">একাউন্ট</string>
<string name="prefs_add_account">একাউন্ট যোগ কর</string>
- <string name="auth_redirect_non_secure_connection_title">নিরাপদ সংযোগকে একটি অনিরাপদ পথে দিকবদল করা হয়েছে</string>
+ <string name="saml_authentication_wrong_pass">ভুল কুটশব্দ</string>
+ <string name="actionbar_move">সরাও</string>
+ <string name="file_list_empty_moving">এখানে কিছু নেই। একটি ফোল্ডার যোগ করতে পারেন!</string>
<string name="move_choose_button_text">বেছে নিন</string>
+ <string name="move_file_not_found">সরাতে ব্যার্থ হলো। ফাইলটি রয়েছে কিনা দেখুন।</string>
+ <string name="prefs_category_security">নিরাপত্তা</string>
</resources>
<string name="downloader_download_file_not_found">El fitxer ja no està disponible en el servidor</string>
<string name="prefs_category_accounts">Comptes</string>
<string name="prefs_add_account">Afegeix compte</string>
- <string name="auth_redirect_non_secure_connection_title">La connexió segura està essent redirigida a través d\'una ruta insegura</string>
<string name="saml_authentication_required_text">Es requereix autenticació</string>
<string name="saml_authentication_wrong_pass">Contrasenya incorrecta</string>
<string name="move_choose_button_text">Escull</string>
+ <string name="prefs_category_security">Seguretat</string>
</resources>
<string name="prefs_category_more">Více</string>
<string name="prefs_accounts">Účty</string>
<string name="prefs_manage_accounts">Spravovat účty</string>
- <string name="prefs_pincode">PIN aplikace</string>
+ <string name="prefs_pincode">PIN do aplikace</string>
<string name="prefs_pincode_summary">Chraňte svého klienta</string>
- <string name="prefs_instant_upload">Okamžité nahrání obrázků</string>
+ <string name="prefs_instant_upload">Okamžité nahrávání obrázků</string>
<string name="prefs_instant_upload_summary">Okamžitě nahrávat vytvořené fotografie</string>
<string name="prefs_instant_video_upload">Okamžité nahrávání videa</string>
<string name="prefs_instant_video_upload_summary">Okamžitě odesílat nahrané video</string>
<string name="prefs_log_summary_history">Zobrazuje zaznamenané logy</string>
<string name="prefs_log_delete_history_button">Smazat historii</string>
<string name="prefs_help">Nápověda</string>
- <string name="prefs_recommend">DoporuÄ\8dit pÅ\99Ãteli</string>
+ <string name="prefs_recommend">DoporuÄ\8dit pÅ\99átelům</string>
<string name="prefs_feedback">Odezva</string>
<string name="prefs_imprint">Imprint</string>
<string name="recommend_subject">Zkuste %1$s na vašem smartphonu!</string>
<string name="placeholder_filesize">389 KB</string>
<string name="placeholder_timestamp">2012/05/18 12:23 PM</string>
<string name="placeholder_media_time">12:23:45</string>
- <string name="instant_upload_on_wifi">Odesílat obrázky pouze skrze WiFi</string>
+ <string name="instant_upload_on_wifi">Odesílat obrázky pouze přes WiFi</string>
<string name="instant_video_upload_on_wifi">Nahrávat videa pouze přes WiFi</string>
<string name="instant_upload_path">/InstantUpload</string>
<string name="conflict_title">Konflikt při aktualizaci</string>
<string name="preview_image_description">Náhled obrázku</string>
<string name="preview_image_error_unknown_format">Obrázek nelze zobrazit</string>
<string name="error__upload__local_file_not_copied">%1$s nelze zkopírovat do místního adresáře %2$s</string>
+ <string name="prefs_instant_upload_path_title">Cesta pro nahrání</string>
<string name="share_link_no_support_share_api">Je nám líto, ale sdílení není na vašem serveru povoleno. Kontaktujte svého
administrátora.</string>
<string name="share_link_file_no_exist">Nelze sdílet. Zkontrolujte prosím že soubor existuje</string>
<string name="downloader_download_file_not_found">Tento soubor již není dostupný na serveru</string>
<string name="prefs_category_accounts">Účty</string>
<string name="prefs_add_account">Přidat účet</string>
- <string name="auth_redirect_non_secure_connection_title">Zabezpečené spojení je přesměrováváno nezabezpečenou trasou.</string>
+ <string name="auth_redirect_non_secure_connection_title">Bezpečné spojení je přesměrováno na nezabezpečenou trasu.</string>
+ <string name="actionbar_logger">Logy</string>
+ <string name="log_send_history_button">Odeslat historii</string>
+ <string name="log_mail_subject">Logy aplikace ownCloud pro Android</string>
+ <string name="log_progress_dialog_text">Načítám data...</string>
<string name="saml_authentication_required_text">Vyžadováno přihlášení</string>
<string name="saml_authentication_wrong_pass">Nesprávné heslo</string>
<string name="actionbar_move">Přesunout</string>
<string name="move_file_invalid_overwrite">Soubor již v cílovém adresáři existuje</string>
<string name="move_file_error">Při pokusu o přesun tohoto souboru či složky nastala chyba</string>
<string name="forbidden_permissions_move">pro přesun tohoto souboru</string>
+ <string name="prefs_category_instant_uploading">Okamžitá odesílání</string>
+ <string name="prefs_category_security">Zabezpečení</string>
</resources>
<string name="actionbar_upload_from_apps">Indhold fra andre apps</string>
<string name="actionbar_upload_files">Filer</string>
<string name="actionbar_open_with">Åben med</string>
- <string name="actionbar_mkdir">Ny Mappe</string>
+ <string name="actionbar_mkdir">Ny mappe</string>
<string name="actionbar_settings">Indstillinger</string>
<string name="actionbar_see_details">Detaljer</string>
<string name="actionbar_send_file">Send</string>
<string name="prefs_category_general">Generel</string>
<string name="prefs_category_more">Mere</string>
<string name="prefs_accounts">Konti</string>
- <string name="prefs_manage_accounts">Administrer konti</string>
+ <string name="prefs_manage_accounts">Administrér konti</string>
<string name="prefs_pincode">App PIN</string>
<string name="prefs_pincode_summary">Beskyt din klient</string>
<string name="prefs_instant_upload">Upload billeder straks</string>
<string name="prefs_instant_upload_summary">Upload straks billeder taget med kameraet</string>
<string name="prefs_instant_video_upload">Upload videoer straks</string>
<string name="prefs_instant_video_upload_summary">Upload straks videor optaget med kameraet</string>
- <string name="prefs_log_title">Aktiver Logning</string>
- <string name="prefs_log_summary">Dette bruges til at logge problemer</string>
+ <string name="prefs_log_title">Aktivér logregistrering</string>
+ <string name="prefs_log_summary">Dette bruges til at logregistrere problemer</string>
<string name="prefs_log_title_history">Logger Historik</string>
<string name="prefs_log_summary_history">Dette viser de optagne logger</string>
- <string name="prefs_log_delete_history_button">Slet Historik</string>
+ <string name="prefs_log_delete_history_button">Slet historik</string>
<string name="prefs_help">Hjælp</string>
<string name="prefs_recommend">Anbefal til en ven</string>
<string name="prefs_feedback">Feedback</string>
<string name="prefs_imprint">Imprint</string>
<string name="recommend_subject">Prøv %1$s på din smartphone!</string>
<string name="recommend_text">Jeg ønsker at invitere dig til at bruge %1$s på din smartphone!\nHent den her: %2$s</string>
- <string name="auth_check_server">Check Server</string>
- <string name="auth_host_url">Server addresse https://…</string>
+ <string name="auth_check_server">Tjek server</string>
+ <string name="auth_host_url">Serveradresse https://…</string>
<string name="auth_username">Brugernavn</string>
<string name="auth_password">Kodeord</string>
<string name="auth_register">Uvant med %1$s</string>
<string name="sync_string_files">Filer</string>
<string name="setup_btn_connect">Tilslut</string>
<string name="uploader_btn_upload_text">Upload</string>
- <string name="uploader_top_message">Vælg upload mappe:</string>
+ <string name="uploader_top_message">Vælg upload-mappe:</string>
<string name="uploader_wrn_no_account_title">Ingen konto fundet</string>
<string name="uploader_wrn_no_account_text">Der er ingen %1$s brugere på din enhed. Sæt venligst en bruger op først.</string>
<string name="uploader_wrn_no_account_setup_btn_text">Opsætning</string>
<string name="filedetails_created">Oprettet:</string>
<string name="filedetails_modified">Ændret:</string>
<string name="filedetails_download">Hent</string>
- <string name="filedetails_sync_file">Opdater fil</string>
+ <string name="filedetails_sync_file">Genopfrisk fil</string>
<string name="filedetails_renamed_in_upload_msg">Filen blev omdøbt til %1$s under upload</string>
<string name="action_share_file">Del link</string>
<string name="action_unshare_file">Ophæv deling</string>
<string name="media_err_security_ex">Sikkerhedsfejl ved forsøg på afspilning af </string>
<string name="media_err_io_ex">Inputfejl ved forsøg på afspilning af %1$s</string>
<string name="media_err_unexpected">Uventet fejl ved forsøg på afspilning af %1$s</string>
- <string name="media_rewind_description">Tilbagespolings knap</string>
+ <string name="media_rewind_description">Tilbagespolingsknap</string>
<string name="media_play_pause_description">Afspil eller pause knap</string>
- <string name="media_forward_description">Hurtigt fremad kanp</string>
+ <string name="media_forward_description">Hurtigt fremad-knap</string>
<string name="auth_getting_authorization">Forsøger godkendelse...</string>
<string name="auth_trying_to_login">Forsøger at logge ind...</string>
<string name="auth_no_net_conn_title">Ingen netværksforbindelse</string>
<string name="auth_account_not_new">En konto for den samme bruger og server eksisterer allerede på enheden</string>
<string name="auth_account_not_the_same">Den indtastede bruger passer ikke til brugeren for denne konto</string>
<string name="auth_unknown_error_title">Ukendt fejl opstod!</string>
- <string name="auth_unknown_host_title">Kunne ikke finde host</string>
+ <string name="auth_unknown_host_title">Kunne ikke finde værten</string>
<string name="auth_incorrect_path_title">Server instans blev ikke fundet</string>
<string name="auth_timeout_title">Serveren var for længe om at svare</string>
<string name="auth_incorrect_address_title">Deform URL</string>
- <string name="auth_ssl_general_error_title">SSL initialisering fejlede</string>
+ <string name="auth_ssl_general_error_title">SSL-initialiseringen fejlede</string>
<string name="auth_ssl_unverified_server_title">Kunne ikke bekræfte SSl-serverens identitet</string>
- <string name="auth_bad_oc_version_title">Ikke genkendt server version</string>
+ <string name="auth_bad_oc_version_title">Ikke genkendt serverversion</string>
<string name="auth_wrong_connection_title">Ikke ikke oprette forbindelse</string>
<string name="auth_secure_connection">Sikker forbindelse oprettet</string>
<string name="auth_unauthorized">Forkert brugernavn eller kodeord</string>
<string name="auth_unsupported_multiaccount">%1$s understøtter ikke multiple konti</string>
<string name="auth_fail_get_user_name">Din server retunere ikke et korrekt bruger-id. Kontakt venligst din administrator</string>
<string name="auth_can_not_auth_against_server">Kan ikke autentificere mod denne server</string>
- <string name="fd_keep_in_sync">Hold fil opdateret</string>
+ <string name="fd_keep_in_sync">Hold filen opdateret</string>
<string name="common_rename">Omdøb</string>
<string name="common_remove">Fjern</string>
<string name="confirmation_remove_alert">Er du sikker på at du vil fjerne %1$s ?</string>
<string name="filedisplay_no_file_selected">Ingen fil blev valgt</string>
<string name="activity_chooser_title">Send link til ...</string>
<string name="oauth_check_onoff">Log på med oAuth2</string>
- <string name="oauth_login_connection">Forbinder til oAuth2 server...</string>
+ <string name="oauth_login_connection">Forbinder til oAuth2-server...</string>
<string name="ssl_validator_header">Sidens identitet kunne ikke verificeres</string>
<string name="ssl_validator_reason_cert_not_trusted">- Serverens certifikat er ikke troværdigt</string>
<string name="ssl_validator_reason_cert_expired">- Serverens certifikat er udløbet</string>
<string name="ssl_validator_null_cert">Certifikatet kunne ikke vises.</string>
<string name="ssl_validator_no_info_about_error">- Ingen information om fejlen</string>
<string name="placeholder_sentence">Dette er en pladsholder</string>
- <string name="placeholder_filename">stedfortræder.txt</string>
+ <string name="placeholder_filename">pladsholder.txt</string>
<string name="placeholder_filetype">PNG Billede</string>
<string name="placeholder_filesize">389 KB</string>
<string name="placeholder_timestamp">2012/05/18 12:23 PM</string>
<string name="placeholder_media_time">12:23:45</string>
- <string name="instant_upload_on_wifi">Upload billeder kun via WiFi </string>
+ <string name="instant_upload_on_wifi">Upload kun billeder via WiFi </string>
<string name="instant_video_upload_on_wifi">Upload kun videoer via WiFi</string>
<string name="instant_upload_path">/Øjeblikkelig upload</string>
<string name="conflict_title">Opdaterings konflikt</string>
<string name="conflict_keep_both">Behold begge</string>
<string name="conflict_overwrite">Overskriv</string>
<string name="conflict_dont_upload">Upload ikke</string>
- <string name="preview_image_description">Billede preview</string>
+ <string name="preview_image_description">Forhåndsvisning af billede</string>
<string name="preview_image_error_unknown_format">Dette billede kan ikke vises</string>
<string name="error__upload__local_file_not_copied">%1$s kunne ikke kopieres til %2$s lokale mappe</string>
<string name="share_link_no_support_share_api">Beklager, deling er ikke slået til på din server. Kontakt venligst din administrator.</string>
<string name="unshare_link_file_no_exist">Kan ikke fjerne deling. Tjek venligst om filen findes.</string>
<string name="unshare_link_file_error">Der opstod en fejl ved stopning af deling af denne mappe.</string>
<string name="activity_chooser_send_file_title">Send</string>
- <string name="copy_link">Kopier link</string>
+ <string name="copy_link">Kopiér link</string>
<string name="clipboard_text_copied">Kopieret til udklipsholder</string>
<string name="error_cant_bind_to_operations_service">Kritisk fejl: kan ikke udføre handlingerne</string>
<string name="network_error_socket_exception">Der opstod en fejl under tilslutningen til serveren.</string>
<string name="downloader_download_file_not_found">Filen er ikke længere tilgængelig på serveren</string>
<string name="prefs_category_accounts">Konti</string>
<string name="prefs_add_account">Tilføj konto</string>
- <string name="auth_redirect_non_secure_connection_title">Sikker forbindelse videredirigeres gennem en usikker rute.</string>
+ <string name="actionbar_logger">Logge</string>
+ <string name="log_send_history_button">Send historik</string>
+ <string name="log_mail_subject">App-logregistreringer for ownCloud Android</string>
+ <string name="log_progress_dialog_text">Indlæser data...</string>
<string name="saml_authentication_required_text">Godkendelse påkrævet</string>
<string name="saml_authentication_wrong_pass">Forkert kodeord</string>
<string name="actionbar_move">Flyt</string>
<string name="move_file_invalid_overwrite">Filen findes allerede i destinationsmappen</string>
<string name="move_file_error">Der opstod en fejl under forsøg på at flytte denne mappe eller fil</string>
<string name="forbidden_permissions_move">til at flytte denne fil</string>
+ <string name="prefs_category_security">Sikkerhed</string>
</resources>
<string name="empty"></string>
<string name="prefs_category_accounts">Konten</string>
<string name="move_choose_button_text">Auswählen</string>
+ <string name="prefs_category_security">Sicherheit</string>
</resources>
<string name="actionbar_upload_from_apps">Inhalt von anderen Apps</string>
<string name="actionbar_upload_files">Dateien</string>
<string name="actionbar_open_with">Öffnen mit</string>
- <string name="actionbar_mkdir">Neues Ordner</string>
+ <string name="actionbar_mkdir">Neuer Ordner</string>
<string name="actionbar_settings">Einstellungen</string>
<string name="actionbar_see_details">Details</string>
<string name="actionbar_send_file">Senden</string>
<string name="prefs_instant_video_upload">Sofortiges Videohochladen</string>
<string name="prefs_instant_video_upload_summary">Videos von der Kamera sofort hochladen</string>
<string name="prefs_log_title">Protokollierung aktivieren</string>
- <string name="prefs_log_summary">Dies wird zur Protokollierung von Problemen genutzt</string>
+ <string name="prefs_log_summary">Dieses wird zur Protokollierung von Problemen benutzt</string>
<string name="prefs_log_title_history">Protokollierungsverlauf</string>
- <string name="prefs_log_summary_history">Dies zeigt die gespeicherten Protokollierungen</string>
+ <string name="prefs_log_summary_history">Dieses zeigt die gespeicherten Protokollierungen</string>
<string name="prefs_log_delete_history_button">Verlauf löschen</string>
<string name="prefs_help">Hilfe</string>
<string name="prefs_recommend">Dieses einem Freund empfehlen</string>
<string name="prefs_feedback">Rückmeldungen</string>
<string name="prefs_imprint">Impressum</string>
- <string name="recommend_subject">Probieren Sie %1$s auf Ihrem Smartphone!</string>
- <string name="recommend_text">Ich möchte Sie zum Benutzen von %1$s auf Ihrem Smartphone einladen!\nLaden Sie es hier herunter: %2$s</string>
+ <string name="recommend_subject">%1$s auf Ihrem Smartphone ausprobieren!</string>
+ <string name="recommend_text">Ich möchte Sie zum Benutzen von %1$s auf Ihrem Smartphone einladen!\nHier herunterladen: %2$s</string>
<string name="auth_check_server">Server überprüfen</string>
<string name="auth_host_url">Server-Adresse https://…</string>
<string name="auth_username">Benutzername</string>
<string name="sync_fail_in_favourites_ticker">Synchronisationsdateien konnten nicht synchronisiert werden.</string>
<string name="sync_fail_in_favourites_content">Inhalte von %1$d konnte nicht synchronisiert werden (%2$d Konflikte)</string>
<string name="sync_foreign_files_forgotten_ticker">Einige lokale Dateien wurden vergessen</string>
- <string name="sync_foreign_files_forgotten_content">%1$d Dateien aus dem %2$s Verzeichnis konnten nicht kopiert werden nach</string>
+ <string name="sync_foreign_files_forgotten_content">%1$d Dateien aus dem %2$s Ordner konnten nicht kopiert werden nach</string>
<string name="sync_foreign_files_forgotten_explanation">Mit Version 1.3.16 werden Dateien die von diesem Gerät aus hochgeladen werden in den lokalen Ordner %1$s kopiert um Datenverlust zu vermeiden, wenn eine einzelne Datei mit mehreren Accounts synchronisiert wird.\n\nInfolge dieser Änderung wurden alle Dateien, die mit vorherigen Versionen dieser App hochgeladen wurden, in den Ordner %2$s verschoben. Jedoch ist während der Account-Synchronisation ein Fehler aufgetreten, der das Abschließen dieses Vorgangs verhindert. Sie können die Datei(en) entweder wie sie sind belassen und den Link zu %3$s entfernen oder die Datei(en) in den %1$s Ordner verschieben und den Link zu %4$s beibehalten.\n\nUnten befindet sich eine Liste der lokalen Datei(en) und der mit ihnen verbundenen Remote-Datei(en) in %5$s.</string>
<string name="sync_current_folder_was_removed">Das Verzeichnis %1$s existiert nicht mehr</string>
<string name="foreign_files_move">Verschiebe alle</string>
<string name="preview_image_description">Bildvorschau</string>
<string name="preview_image_error_unknown_format">Dieses Bild kann nicht angezeigt werden</string>
<string name="error__upload__local_file_not_copied">%1$s konnte nicht in den lokalen %2$s Ordner kopiert werden</string>
+ <string name="prefs_instant_upload_path_title">Pfad hochladen</string>
<string name="share_link_no_support_share_api">Entschuldigung, Freigaben sind auf Ihrem Server nicht aktiviert. Bitte kontaktieren Sie Ihren
⇥⇥Administrator.</string>
<string name="share_link_file_no_exist">Teilen nicht möglich. Prüfen Sie, dass die Datei existiert</string>
<string name="prefs_category_accounts">Konten</string>
<string name="prefs_add_account">Konto hinzufügen</string>
<string name="auth_redirect_non_secure_connection_title">Die gesicherte Verbindung wird auf eine unsichere Route weitergeleitet.</string>
- <string name="saml_authentication_required_text">Authentifizierung benötigt</string>
+ <string name="actionbar_logger">Protokolle</string>
+ <string name="log_send_history_button">Verlauf senden</string>
+ <string name="log_mail_subject">Protokolle der ownCloud-Android-App</string>
+ <string name="log_progress_dialog_text">Daten werden geladen …</string>
+ <string name="saml_authentication_required_text">Legitimierung benötigt</string>
<string name="saml_authentication_wrong_pass">Falsches Passwort</string>
<string name="actionbar_move">Verschieben</string>
<string name="file_list_empty_moving">Nichts vorhanden. Sie können einen Ordner hinzufügen!</string>
<string name="move_choose_button_text">Auswählen</string>
- <string name="move_file_not_found">Verschieben nicht möglich. Prüfen Sie, ob die Datei existiert</string>
+ <string name="move_file_not_found">Verschieben nicht möglich. Bitte überprüfen Sie, ob die Datei existiert</string>
<string name="move_file_invalid_into_descendent">Es ist nicht möglich einen Ordner eine Ebene tiefer zu verschieben</string>
- <string name="move_file_invalid_overwrite">Die Datei existiert bereits im Zielordner</string>
- <string name="move_file_error">Es ist ein Fehler beim Verschieben dieser Datei oder Ordners aufgetreten.</string>
+ <string name="move_file_invalid_overwrite">Die Datei ist bereits im Zielordner vorhanden</string>
+ <string name="move_file_error">Es ist ein Fehler beim Verschieben dieser Datei oder dieses Ordners aufgetreten.</string>
<string name="forbidden_permissions_move">um diese Datei zu verschieben</string>
+ <string name="prefs_category_instant_uploading">Sofortiges Hochladen</string>
+ <string name="prefs_category_security">Sicherheit</string>
</resources>
<string name="sync_fail_in_favourites_content">Inhalte von %1$d konnte nicht synchronisiert werden (%2$d Konflikte)</string>
<string name="sync_foreign_files_forgotten_ticker">Einige lokale Dateien wurden vergessen</string>
<string name="sync_foreign_files_forgotten_content">%1$d Dateien aus dem %2$s Verzeichnis konnten nicht kopiert werden nach</string>
- <string name="sync_foreign_files_forgotten_explanation">Mit Version 1.3.16 werden Dateien die von diesem Gerät aus hochgeladen werden in den lokalen Ordner %1$s kopiert um Datenverlust zu vermeiden, wenn eine einzelne Datei mit mehreren Accounts synchronisiert wird.\n\nInfolge dieser Änderung wurden alle Dateien, die mit vorherigen Versionen dieser App hochgeladen wurden, in den Ordner %2$s verschoben. Jedoch ist während der Account-Synchronisation ein Fehler aufgetreten, der das Abschließen dieses Vorgangs verhindert. Du kannst die Datei(en) entweder wie sie sind belassen und den Link zu %3$s entfernen oder die Datei(en) in den %1$s Ordner verschieben und den Link zu %4$s beibehalten.\n\nUnten befindet sich eine Liste der lokalen Datei(en) und der mit ihnen verbundenen Remote-Datei(en) in %5$s.</string>
+ <string name="sync_foreign_files_forgotten_explanation">Mit Version 1.3.16 werden Dateien die von diesem Gerät aus hochgeladen werden in den lokalen Ordner %1$s kopiert um Datenverlust zu vermeiden, wenn eine einzelne Datei mit mehreren Accounts synchronisiert wird.\n\nInfolge dieser Änderung wurden alle Dateien, die mit vorherigen Versionen dieser App hochgeladen wurden, in den Ordner %2$s verschoben. Jedoch ist während der Account-Synchronisation ein Fehler aufgetreten, der das Abschließen dieses Vorgangs verhindert. Du kannst die Datei(en) entweder wie sie sind belassen und den Link zu %3$s entfernen oder die Datei(en) in den Ordner %1$s verschieben und den Link zu %4$s beibehalten.\n\nUnten befindet sich eine Liste der lokalen Datei(en) und der mit ihnen verbundenen Remote-Datei(en) in %5$s.</string>
<string name="sync_current_folder_was_removed">Das Verzeichnis %1$s existiert nicht mehr</string>
<string name="foreign_files_move">Verschiebe alle</string>
<string name="foreign_files_success">Alle Dateien wurden verschoben</string>
<string name="preview_image_description">Bildvorschau</string>
<string name="preview_image_error_unknown_format">Dieses Bild kann nicht angezeigt werden</string>
<string name="error__upload__local_file_not_copied">%1$s konnte nicht in den lokalen %2$s Ordner kopiert werden</string>
+ <string name="prefs_instant_upload_path_title">Pfad hochladen</string>
<string name="share_link_no_support_share_api">Entschuldigung, Freigaben sind auf Deinem Server nicht aktiviert. Bitte kontaktiere Deinen
⇥⇥Administrator.</string>
<string name="share_link_file_no_exist">Teilen nicht möglich. Prüfe, dass die Datei existiert</string>
<string name="prefs_category_accounts">Konten</string>
<string name="prefs_add_account">Konto hinzufügen</string>
<string name="auth_redirect_non_secure_connection_title">Die gesicherte Verbindung wird auf eine unsichere Route weitergeleitet.</string>
- <string name="saml_authentication_required_text">Authentifizierung benötigt</string>
+ <string name="actionbar_logger">Protokolle</string>
+ <string name="log_send_history_button">Verlauf senden</string>
+ <string name="log_mail_subject">Protokolle der ownCloud-Android-App</string>
+ <string name="log_progress_dialog_text">Daten werden geladen …</string>
+ <string name="saml_authentication_required_text">Legitimierung benötigt</string>
<string name="saml_authentication_wrong_pass">Falsches Passwort</string>
<string name="actionbar_move">Verschieben</string>
<string name="file_list_empty_moving">Nichts vorhanden. Du kannst einen Ordner hinzufügen!</string>
<string name="move_choose_button_text">Auswählen</string>
<string name="move_file_not_found">Verschieben nicht möglich. Prüfe, dass die Datei existiert</string>
- <string name="move_file_invalid_into_descendent">Es ist nicht möglich einen Ordner eine Ebene tiefer zu verschieben</string>
- <string name="move_file_invalid_overwrite">Die Datei existiert bereits im Zielordner</string>
- <string name="move_file_error">Es ist ein Fehler beim Verschieben dieser Datei oder Ordners aufgetreten.</string>
- <string name="forbidden_permissions_move">zum Datei verschieben</string>
+ <string name="move_file_invalid_into_descendent">Es ist nicht möglich, einen Ordner in einen seiner Unterordner zu verschieben</string>
+ <string name="move_file_invalid_overwrite">Die Datei ist bereits im Zielordner vorhanden</string>
+ <string name="move_file_error">Es ist ein Fehler beim Verschieben der Datei oder des Ordners aufgetreten.</string>
+ <string name="forbidden_permissions_move">um diese Datei zu verschieben</string>
+ <string name="prefs_category_instant_uploading">Sofortiges Hochladen</string>
+ <string name="prefs_category_security">Sicherheit</string>
</resources>
<string name="prefs_feedback">Σχόλια </string>
<string name="prefs_imprint">Αποτύπωμα</string>
<string name="recommend_subject">Δοκιμάστε %1$s στο κινητό σας!</string>
+ <string name="recommend_text">Θα ήθελα να σε προσκαλέσω να χρησιμοποιήσεις το %1$s στο κινητό σου!\nΛήψη εδώ: %2$s</string>
<string name="auth_check_server">Έλεγχος Διακομιστή</string>
<string name="auth_host_url">Διεύθυνση διακομιστή https://…</string>
<string name="auth_username">Όνομα χρήστη</string>
<string name="downloader_download_file_not_found">Αυτό το αρχείο δεν είναι πια διαθέσιμο στο διακομιστή</string>
<string name="prefs_category_accounts">Λογαριασμοί</string>
<string name="prefs_add_account">Προσθήκη λογαριασμού</string>
- <string name="auth_redirect_non_secure_connection_title">Ασφαλής σύνδεση ανακατευθύνεται μέσω μιας μη ασφαλούς διαδρομής.</string>
+ <string name="actionbar_logger">Αρχεία καταγραφών</string>
+ <string name="log_send_history_button">Αποστολή ιστορικού</string>
+ <string name="log_progress_dialog_text">Φόρτωση δεδομένων....</string>
<string name="saml_authentication_required_text">Απαιτείται πιστοποίηση</string>
<string name="saml_authentication_wrong_pass">Εσφαλμένο συνθηματικό</string>
+ <string name="actionbar_move">Μετακίνηση</string>
<string name="move_choose_button_text">Επιλέξτε</string>
+ <string name="move_file_invalid_overwrite">Το αρχείο υπάρχει ήδη στο φάκελο προορισμού</string>
+ <string name="forbidden_permissions_move">για μετακίνηση αυτού του αρχείου</string>
+ <string name="prefs_category_security">Ασφάλεια</string>
</resources>
<string name="prefs_feedback">Feedback</string>
<string name="prefs_imprint">Imprint</string>
<string name="recommend_subject">Try %1$s on your smartphone!</string>
+ <string name="recommend_text">I want to invite you to use %1$s on your smartphone!\nDownload here: %2$s</string>
<string name="auth_check_server">Check Server</string>
<string name="auth_host_url">Server address https://…</string>
<string name="auth_username">Username</string>
<string name="preview_image_description">Image preview</string>
<string name="preview_image_error_unknown_format">This image cannot be shown</string>
<string name="error__upload__local_file_not_copied">%1$s could not be copied to %2$s local folder</string>
+ <string name="prefs_instant_upload_path_title">Upload Path</string>
<string name="share_link_no_support_share_api">Sorry, sharing is not enabled on your server. Please contact your
administrator.</string>
<string name="share_link_file_no_exist">Unable to share. Please check whether the file exists</string>
<string name="downloader_download_file_not_found">The file is no longer available on the server</string>
<string name="prefs_category_accounts">Accounts</string>
<string name="prefs_add_account">Add account</string>
- <string name="auth_redirect_non_secure_connection_title">Secure connection is redirected through an unsecured route.</string>
+ <string name="auth_redirect_non_secure_connection_title">Secure connection is redirected to an unsecured route.</string>
+ <string name="actionbar_logger">Logs</string>
+ <string name="log_send_history_button">Send History</string>
+ <string name="log_mail_subject">ownCloud Android app logs</string>
+ <string name="log_progress_dialog_text">Loading data...</string>
<string name="saml_authentication_required_text">Authentication required</string>
<string name="saml_authentication_wrong_pass">Incorrect password</string>
<string name="actionbar_move">Move</string>
<string name="move_file_invalid_overwrite">The file exists already in the destination folder</string>
<string name="move_file_error">An error occurred whilst trying to move this file or folder</string>
<string name="forbidden_permissions_move">to move this file</string>
+ <string name="prefs_category_instant_uploading">Instant Uploads</string>
+ <string name="prefs_category_security">Security</string>
</resources>
<string name="saml_authentication_required_text">Aŭtentiĝo nepras</string>
<string name="saml_authentication_wrong_pass">Malĝusta pasvorto</string>
<string name="move_choose_button_text">Elekti</string>
+ <string name="prefs_category_security">Sekuro</string>
</resources>
<string name="saml_authentication_required_text">Autentificación requerida</string>
<string name="saml_authentication_wrong_pass">Clave incorrecta</string>
<string name="move_choose_button_text">Elegir</string>
+ <string name="prefs_category_security">Seguridad</string>
</resources>
<string name="prefs_category_accounts">Cuentas</string>
<string name="saml_authentication_wrong_pass">Contraseña incorrecta</string>
<string name="move_choose_button_text">Seleccionar</string>
+ <string name="prefs_category_security">Seguridad</string>
</resources>
<?xml version='1.0' encoding='UTF-8'?>
<resources>
+ <string name="actionbar_upload_files">Archivos</string>
+ <string name="sync_string_files">Archivos</string>
<string name="empty"></string>
</resources>
<string name="sync_conflicts_in_favourites_ticker">Se encontraron conflictos</string>
<string name="sync_conflicts_in_favourites_content">Falló la sincronización de contenidos de %1$d ficheros</string>
<string name="sync_fail_in_favourites_ticker">Fallos en la sincronización de contenidos</string>
- <string name="sync_fail_in_favourites_content">Los contenidos de %1$d ficheros no se han sincronizado (%2$d conflictos)</string>
+ <string name="sync_fail_in_favourites_content">Los contenidos de %1$d archivos no pudieron sincronizarse (%2$d conflictos)</string>
<string name="sync_foreign_files_forgotten_ticker">Algunos archivos locales se han perdido</string>
<string name="sync_foreign_files_forgotten_content">%1$d archivos en la carpeta %2$s no pudieron ser copiados a</string>
+ <string name="sync_foreign_files_forgotten_explanation">A partir de la versión 1.3.16, los ficheros subidos desde este dispositivo se copian en la carpeta local %1$s para evitar la pérdida de datos cuando se sincroniza un único archivo con varias cuentas.\n\nDebido a este cambio, todos los ficheros subidos con versiones anteriores de esta aplicación fueron copiados a la carpeta %2$s. Sin embargo, un error impidió que se completara esta operación durante la sincronización de la cuenta. Puede dejar los archivos tal y como están y eliminar el enlace a %3$s o mover los archivos a la carpeta %1$s y mantener el enlace a %4$s.\n\nDebajo se muestran los archivos locales y los archivos remotos en %5$s a los que fueron enlazados.</string>
<string name="sync_current_folder_was_removed">La carpeta local %1$s no existe.</string>
<string name="foreign_files_move">Mover todo</string>
<string name="foreign_files_success">Todos los archivos fueron movidos</string>
<string name="auth_account_not_new">Ya existe una cuenta en este dispositivo con los mismos datos de Usuario y Servidor</string>
<string name="auth_account_not_the_same">El usuario introducido no concuerda con el usuario de esta cuenta</string>
<string name="auth_unknown_error_title">Ocurrió un error desconocido</string>
- <string name="auth_unknown_host_title">No se pudo encontrar la dirección</string>
+ <string name="auth_unknown_host_title">Error: no se pudo encontrar el host</string>
<string name="auth_incorrect_path_title">Instancia de servidor no encontrada</string>
<string name="auth_timeout_title">El servidor ha tardado demasiado en responder</string>
<string name="auth_incorrect_address_title">URL no válida</string>
<string name="auth_ssl_general_error_title">Falló la inicialización SSL</string>
- <string name="auth_ssl_unverified_server_title">No fue posible verificar la identidad del servidor SLL</string>
+ <string name="auth_ssl_unverified_server_title">No fue posible verificar la identidad del servidor SSL</string>
<string name="auth_bad_oc_version_title">No se reconoce la versión del servidor </string>
<string name="auth_wrong_connection_title">No se ha podido establecer la conexión</string>
<string name="auth_secure_connection">Conexión segura establecida</string>
<string name="ssl_validator_header">La identidad del sitio no puede ser verificada</string>
<string name="ssl_validator_reason_cert_not_trusted">- El certificado del servidor no es de confianza</string>
<string name="ssl_validator_reason_cert_expired">- El certificado del servidor expiró</string>
- <string name="ssl_validator_reason_cert_not_yet_valid">- El certificado del servidor es demasiado reciente</string>
+ <string name="ssl_validator_reason_cert_not_yet_valid">- El certificado del servidor es de una fecha que aún no llega</string>
<string name="ssl_validator_reason_hostname_not_verified">- La URL no coincide con el nombre de dominio del certificado</string>
<string name="ssl_validator_question">¿Confías de todas formas en este certificado?</string>
<string name="ssl_validator_not_saved">El certificado no pudo ser guardado</string>
<string name="conflict_dont_upload">No subir</string>
<string name="preview_image_description">Previsualización de imagen</string>
<string name="preview_image_error_unknown_format">No se puede mostrar la imagen</string>
- <string name="error__upload__local_file_not_copied">%1$s no pudo ser copiado a la carpeta local %2$s</string>
+ <string name="error__upload__local_file_not_copied">%1$s se pudo copiar a la carpeta local %2$s</string>
+ <string name="prefs_instant_upload_path_title">Ruta de subida</string>
<string name="share_link_no_support_share_api">La función Compartir no está activada en su servidor. Contacte a su
administrador.</string>
<string name="share_link_file_no_exist">No se puede compartir. Revise si el archivo existe</string>
<string name="forbidden_permissions_rename">para renombrar este archivo</string>
<string name="forbidden_permissions_delete">para eliminar este archivo</string>
<string name="share_link_forbidden_permissions">para compartir este archivo</string>
- <string name="unshare_link_forbidden_permissions">para ya no compartir este archivo</string>
+ <string name="unshare_link_forbidden_permissions">para dejar de compartir este archivo</string>
<string name="forbidden_permissions_create">para crear el archivo</string>
<string name="uploader_upload_forbidden_permissions">para subir archivos a esta carpeta</string>
<string name="downloader_download_file_not_found">Este archivo ya no se encuentra en el servidor</string>
<string name="prefs_category_accounts">Cuentas</string>
<string name="prefs_add_account">Agregar cuenta</string>
- <string name="auth_redirect_non_secure_connection_title">La conexión segura está siendo redirigida por una ruta insegura.</string>
+ <string name="auth_redirect_non_secure_connection_title">La conexión segura está siendo desviada por una ruta insegura.</string>
+ <string name="actionbar_logger">Logs</string>
+ <string name="log_send_history_button">Enviar historial</string>
+ <string name="log_mail_subject">Logs de las apps ownCloud Android</string>
+ <string name="log_progress_dialog_text">Cargando datos...</string>
<string name="saml_authentication_required_text">Se necesita autenticación</string>
<string name="saml_authentication_wrong_pass">Contraseña incorrecta</string>
<string name="actionbar_move">Mover</string>
<string name="file_list_empty_moving">Aquí no hay nada. ¡Puede agregar una carpeta!</string>
<string name="move_choose_button_text">Seleccionar</string>
<string name="move_file_not_found">No se puede mover. Revise si el archivo existe</string>
+ <string name="move_file_invalid_into_descendent">No se puede mover una carpeta dentro de una de SUS subcarpetas.</string>
<string name="move_file_invalid_overwrite">El archivo ya existe en la carpeta de destino</string>
<string name="move_file_error">Hubo un error al tratar de mover este archivo o carpeta</string>
<string name="forbidden_permissions_move">para mover este archivo</string>
+ <string name="prefs_category_instant_uploading">Subidas instantáneas</string>
+ <string name="prefs_category_security">Seguridad</string>
</resources>
<string name="prefs_feedback">Tagasiside</string>
<string name="prefs_imprint">Impressum</string>
<string name="recommend_subject">Proovi oma nutitelefonil rakendust %1$s!</string>
+ <string name="recommend_text">Kutsun sind kasutama oma nutitelefonis rakendust %1$s!\nLaadi see alla siit: %2$s</string>
<string name="auth_check_server">Kontrolli serverit</string>
<string name="auth_host_url">Serveri aadress https://...</string>
<string name="auth_username">Kasutajanimi</string>
<string name="preview_image_description">Pildi eelvaade</string>
<string name="preview_image_error_unknown_format">Seda pilti ei saa näidata</string>
<string name="error__upload__local_file_not_copied">%1$s ei suudetud kopeerida kohalikku kataloogi %2$s</string>
+ <string name="prefs_instant_upload_path_title">Üleslaadimise rada</string>
<string name="share_link_no_support_share_api">Vabandust, server ei toeta jagamist. Palun kontakteeru
⇥⇥administraatoriga.</string>
<string name="share_link_file_no_exist">Jagamine ebaõnnestus. Palun kontrolli, kas fail on olemas</string>
<string name="downloader_download_file_not_found">Fail ei ole serveris enam kättesaadav</string>
<string name="prefs_category_accounts">Kontod</string>
<string name="prefs_add_account">Lisa konto</string>
- <string name="auth_redirect_non_secure_connection_title">Turvalist ühendust suunatakse läbi turvamata ühenduse.</string>
+ <string name="auth_redirect_non_secure_connection_title">Turvaline ühendus suunatakse läbi turvamata ühenduse.</string>
+ <string name="actionbar_logger">Logid</string>
+ <string name="log_send_history_button">Saada ajalugu</string>
+ <string name="log_mail_subject">ownCloud Android rakenduse logid</string>
+ <string name="log_progress_dialog_text">Andmete laadimine...</string>
<string name="saml_authentication_required_text">Autentimine on vajalik</string>
<string name="saml_authentication_wrong_pass">Vale parool</string>
<string name="actionbar_move">Tõsta ümber</string>
<string name="move_file_invalid_overwrite">See fail on juba sihtkaustas olemas</string>
<string name="move_file_error">Selle faili või kausta liigutamisel tekkis tõrge</string>
<string name="forbidden_permissions_move">selle faili liigutamiseks</string>
+ <string name="prefs_category_instant_uploading">Kohesed üleslaadimised</string>
+ <string name="prefs_category_security">Turvalisus</string>
</resources>
<string name="downloader_download_file_not_found">Fitxategia jadanik ez dago eskuragarri zerbitzarian</string>
<string name="prefs_category_accounts">Kontuak</string>
<string name="prefs_add_account">Gehitu kontua</string>
- <string name="auth_redirect_non_secure_connection_title">Konexio segurua birbideratu da segurua ez den bide batetik.</string>
<string name="saml_authentication_required_text">Autentikazioa beharrezkoa</string>
<string name="saml_authentication_wrong_pass">Pasahitz okerra</string>
<string name="move_choose_button_text">Aukeratu</string>
+ <string name="prefs_category_security">Segurtasuna</string>
</resources>
<string name="saml_authentication_required_text">احراز هویت مورد نیاز است</string>
<string name="saml_authentication_wrong_pass">رمز عبور اشتباه است</string>
<string name="move_choose_button_text">انتخاب کردن</string>
+ <string name="prefs_category_security">امنیت</string>
</resources>
<string name="prefs_recommend">Suosittele kaverille</string>
<string name="prefs_feedback">Palaute</string>
<string name="recommend_subject">Kokeile %1$sia älypuhelimellasi!</string>
+ <string name="recommend_text">Kutsun sinut käyttämään %1$sia älypuhelimellasi!\nLataa se tästä: %2$s</string>
<string name="auth_check_server">Tarkista palvelin</string>
<string name="auth_host_url">Palvelinosoite https://…</string>
<string name="auth_username">Käyttäjätunnus</string>
<string name="conflict_dont_upload">Älä lähetä</string>
<string name="preview_image_description">Kuvan esikatselu</string>
<string name="preview_image_error_unknown_format">Tätä kuvaa ei voi näyttää</string>
+ <string name="prefs_instant_upload_path_title">Lähetyspolku</string>
<string name="share_link_no_support_share_api">Jakaminen ei ole käytössä palvelimellasi. Ota yhteys
ylläpitäjään.</string>
<string name="share_link_file_error">Virhe tiedoston tai kansion jakamista yrittäessä</string>
<string name="downloader_download_file_not_found">Tämä tiedosto ei ole enää palvelimella käytettävissä</string>
<string name="prefs_category_accounts">Tilit</string>
<string name="prefs_add_account">Lisää tili</string>
- <string name="auth_redirect_non_secure_connection_title">Salattu yhteys on ohjattu uudelleen salaamatonta reittiä pitkin.</string>
+ <string name="actionbar_logger">Lokit</string>
+ <string name="log_send_history_button">Lähetä historia</string>
+ <string name="log_mail_subject">ownCloudin Android-sovelluksen lokit</string>
+ <string name="log_progress_dialog_text">Ladataan tietoja...</string>
<string name="saml_authentication_required_text">Tunnistautuminen vaaditaan</string>
<string name="saml_authentication_wrong_pass">Väärä salasana</string>
<string name="actionbar_move">Siirrä</string>
<string name="move_file_not_found">Siirto ei onnistu. Tarkista, ettei tiedostoa ole jo olemassa</string>
<string name="move_file_invalid_overwrite">Tiedosto on jo olemassa kohdekansiossa</string>
<string name="move_file_error">Tämän tiedoston tai kansion siirtoa yrittäessä tapahtui virhe</string>
+ <string name="prefs_category_instant_uploading">Välittömät lähetykset</string>
+ <string name="prefs_category_security">Tietoturva</string>
</resources>
<string name="prefs_accounts">Comptes</string>
<string name="prefs_manage_accounts">Gestion des comptes utilisateur</string>
<string name="prefs_pincode">Utilisation d\'un code de sécurité</string>
- <string name="prefs_pincode_summary">Protéger l\'accès aux données maniplulées par le client</string>
+ <string name="prefs_pincode_summary">Protéger l\'accès aux données manipulées par le client</string>
<string name="prefs_instant_upload">Téléchargements instantanés d\'images</string>
<string name="prefs_instant_upload_summary">Téléversement instantané des photos prises par la caméra</string>
<string name="prefs_instant_video_upload">Téléchargements instantanés de vidéos</string>
<string name="prefs_feedback">Commentaires</string>
<string name="prefs_imprint">Empreinte</string>
<string name="recommend_subject">Essayez %1$s sur votre smartphone !</string>
+ <string name="recommend_text">J\'aimerais vous inviter à utiliser %1$s sur votre smartphone !
+Téléchargez-le ici : %2$s</string>
<string name="auth_check_server">Vérifier le serveur</string>
<string name="auth_host_url">Adresse du serveur https://...</string>
<string name="auth_username">Nom d\'utilisateur</string>
<string name="sync_fail_in_favourites_content">Le contenu de %1$d fichiers n\'a put être synchronisé (%2$d conflits)</string>
<string name="sync_foreign_files_forgotten_ticker">Certains fichiers locaux ont été oubliés</string>
<string name="sync_foreign_files_forgotten_content">%1$d fichiers du dossier %2$s n\'ont pas pu être copiés dans</string>
+ <string name="sync_foreign_files_forgotten_explanation">Depuis la version 1.3.16, les fichiers envoyé depuis ce périphérique sont copiés dans le dossier local %1$s pour éviter une perte de données lorsqu\'un même fichier est synchronisé avec plusieurs comptes.
+
+En raison de cette modification, tous les fichiers envoyés avec des versions antérieures de cette application ont été copiés dans le dossier %2$s. Cependant une erreur a empêché l\'achèvement de cette opération pendant la synchronisation du compte. Vous pouvez soit laisser les fichiers tels quels et supprimer le lien vers %3$s, soit déplacer les fichiers dans le dossier %1$s et garder le lien vers %4$s.
+
+Ci-dessous la liste des fichiers locaux, et les fichiers distants dans %5$s auxquels ils étaient liés.</string>
<string name="sync_current_folder_was_removed">Le dossier %1$s n\'existe plus</string>
<string name="foreign_files_move">Tout déplacer</string>
<string name="foreign_files_success">Tous les fichiers ont été déplacés</string>
<string name="auth_bad_oc_version_title">La version du serveur n\'est pas reconnue</string>
<string name="auth_wrong_connection_title">Impossible d\'établir la connexion</string>
<string name="auth_secure_connection">Connexion sécurisée établie</string>
- <string name="auth_unauthorized">Nom d\'utilisateur ou mot de passe invalide</string>
+ <string name="auth_unauthorized">Nom d\'utilisateur ou mot de passe incorrect</string>
<string name="auth_oauth_error">Echec d\'autorisation</string>
<string name="auth_oauth_error_access_denied">Accès refusé par le serveur d\'autorisation</string>
<string name="auth_wtf_reenter_URL">État inattendu ; veuillez entrer à nouveau l\'URL du serveur</string>
<string name="preview_image_error_unknown_format">Cette image ne peut pas être affichée</string>
<string name="error__upload__local_file_not_copied">%1$s n\'a pas pu être copié dans le dossier local %2$s</string>
<string name="share_link_no_support_share_api">Désolé, le partage n\'est pas disponible sur votre serveur. Contactez votre administrateur, s\'il vous plait.</string>
+ <string name="share_link_file_no_exist">Impossible de partager. Vérifiez que le fichier est bien présent</string>
<string name="share_link_file_error">Une erreur est survenue lors de la tentative de partage de ce fichier ou répertoire</string>
+ <string name="unshare_link_file_no_exist">Impossible de supprimer le partage. Vérifiez que le fichier est bien présent</string>
<string name="unshare_link_file_error">Une erreur est survenue lors de la tentative d’annulation du partage de ce fichier ou répertoire</string>
<string name="activity_chooser_send_file_title">Envoyer</string>
<string name="copy_link">Copier le lien</string>
<string name="downloader_download_file_not_found">Ce fichier n’est plus disponible sur le serveur</string>
<string name="prefs_category_accounts">Comptes</string>
<string name="prefs_add_account">Ajouter un compte</string>
+ <string name="actionbar_logger">Journaux</string>
+ <string name="log_send_history_button">Envoyer l\'historique</string>
+ <string name="log_mail_subject">Journaux de l\'application Android ownCloud</string>
+ <string name="log_progress_dialog_text">Chargement des données...</string>
<string name="saml_authentication_required_text">Authentification requise</string>
<string name="saml_authentication_wrong_pass">Mot de passe incorrect</string>
<string name="actionbar_move">Déplacer</string>
+ <string name="file_list_empty_moving">Il n\'y a rien ici. Vous pouvez ajouter un dossier !</string>
<string name="move_choose_button_text">Choisir</string>
+ <string name="move_file_not_found">Impossible de déplacer. Vérifiez que le fichier existe</string>
+ <string name="move_file_invalid_into_descendent">Il n\'est pas possible de déplacer un dossier vers un de ses descendants</string>
+ <string name="move_file_invalid_overwrite">Le fichier existe déjà dans le dossier de destination</string>
+ <string name="move_file_error">Une erreur est survenue lors de la tentative de déplacement de ce fichier ou dossier</string>
+ <string name="forbidden_permissions_move">de déplacer ce fichier</string>
+ <string name="prefs_category_security">Sécurité</string>
</resources>
--- /dev/null
+<?xml version='1.0' encoding='UTF-8'?>
+<resources>
+ <string name="empty"></string>
+</resources>
<string name="downloader_download_file_not_found">O ficheiro xa non está dispoñíbel no servidor</string>
<string name="prefs_category_accounts">Contas</string>
<string name="prefs_add_account">Engadir unha conta</string>
- <string name="auth_redirect_non_secure_connection_title">A conexión segura está a ser redirixida a través dunha ruta non segura.</string>
<string name="saml_authentication_required_text">Requírese autenticación</string>
<string name="saml_authentication_wrong_pass">Contrasinal incorrecto</string>
<string name="actionbar_move">Mover</string>
<string name="move_choose_button_text">Escoller</string>
+ <string name="prefs_category_security">Seguranza</string>
</resources>
<string name="downloader_download_file_not_found">הקובץ אינו זמין יותר על השרת</string>
<string name="prefs_category_accounts">חשבונות</string>
<string name="prefs_add_account">הוספת חשבון</string>
- <string name="auth_redirect_non_secure_connection_title">חיבור מאובטח מנותב דרך נתיב לא מאובטח</string>
<string name="move_choose_button_text">בחירה</string>
+ <string name="prefs_category_security">אבטחה</string>
</resources>
<string name="saml_authentication_required_text">Potrebna autentikacija</string>
<string name="saml_authentication_wrong_pass">Pogrešna lozinka</string>
<string name="move_choose_button_text">Izaberi</string>
+ <string name="prefs_category_security">Sigurnost</string>
</resources>
<string name="uploader_upload_succeeded_content_single">%1$s sikeresen fel lett töltve</string>
<string name="uploader_upload_failed_ticker">A feltöltés nem sikerült</string>
<string name="uploader_upload_failed_content_single"> %1$s fájl feltöltése sikertelen</string>
+ <string name="uploader_upload_failed_credentials_error">Feltöltés sikertelen, jelentkezz be újra</string>
<string name="downloader_download_in_progress_ticker">Letöltés ...</string>
<string name="downloader_download_in_progress_content">%1$d%% Letöltés %2$s</string>
<string name="downloader_download_succeeded_ticker">A letöltés sikeres</string>
<string name="downloader_download_failed_ticker">A letöltés sikertelen</string>
<string name="downloader_download_failed_content">A letöltésből %1$s nem lett befejezve</string>
<string name="downloader_not_downloaded_yet">Még nem töltötte le</string>
+ <string name="downloader_download_failed_credentials_error">Letöltés sikertelen, jelentkezz be újra.</string>
<string name="common_choose_account">Válasszon azonosítót</string>
<string name="sync_fail_ticker">A szinkronizálás sikertelen</string>
+ <string name="sync_fail_ticker_unauthorized">Szinkronizálás sikertelen, jelentkezz be újra.</string>
<string name="sync_fail_content">%1$s szinkronizációját nem sikerült befejezni</string>
<string name="sync_fail_content_unauthorized">Érvénytelen jelszó a következőhöz %1$s</string>
<string name="sync_conflicts_in_favourites_ticker">Ütközések vannak</string>
<string name="foreign_files_fail">Egyes fájlokat nem sikerült áthelyezni</string>
<string name="foreign_files_local_text">Helyi: %1$s</string>
<string name="foreign_files_remote_text">Távoli: %1$s</string>
+ <string name="upload_query_move_foreign_files">Nincs elég hely a kiválasztott fájlok másolására a %1$s könyvtárban. Szeretnéd áthelyezni inkább?</string>
<string name="pincode_enter_pin_code">Kérem adja meg az alkalmazás PIN-kódját</string>
<string name="pincode_configure_your_pin">Az alkalmazás PIN-kódja</string>
<string name="pincode_configure_your_pin_explanation">A PIN-t kötelező lesz megadni az alkalmazás minden indításakor</string>
<string name="auth_connecting_auth_server">Kapcsolódás a felhasználóazonosítást végző kiszolgálóhoz...</string>
<string name="auth_unsupported_auth_method">A kiszolgáló nem támogatja ezt a felhasználóazonosítási módszert</string>
<string name="auth_unsupported_multiaccount">%1$s nem támogat több bejelenkezési jogosultságot</string>
+ <string name="auth_can_not_auth_against_server">Nem tudod hitelesíteni magadat ezen a szerveren</string>
<string name="fd_keep_in_sync">Automatikusan frissítse a fájlokat</string>
<string name="common_rename">Átnevezés</string>
<string name="common_remove">Eltávolítás</string>
+ <string name="confirmation_remove_alert">Tényleg el akarod távolítani %1$s?</string>
+ <string name="confirmation_remove_folder_alert">Tényleg el akarod távolítani a %1$s és tartalmát?</string>
<string name="confirmation_remove_local">Csak a helyi példány</string>
<string name="confirmation_remove_folder_local">Csak a helyi tartalmat</string>
<string name="confirmation_remove_remote">Törlés a szerverről</string>
<string name="rename_server_fail_msg">Az átnevezés nem sikerült</string>
<string name="sync_file_fail_msg">A távoli fájl nem volt ellenőrizhető</string>
<string name="sync_file_nothing_to_do_msg">Az állományok már szinkonizálva vannak</string>
+ <string name="create_dir_fail_msg">A könyvtárt nem lehet létrehozni</string>
<string name="filename_forbidden_characters">Nem megendedett karakterek: / \\ < > : \" | ? *</string>
+ <string name="filename_empty">A fájl név nem lehet üres</string>
<string name="wait_a_moment">Egy pillanat...</string>
<string name="filedisplay_unexpected_bad_get_content">Váratlan hiba; válassza ki a fájlt más programból</string>
<string name="filedisplay_no_file_selected">Egy fájl sincs kiválasztva</string>
<string name="placeholder_timestamp">2012/05/18 12:23</string>
<string name="placeholder_media_time">12:23:45</string>
<string name="instant_upload_on_wifi">Képeket csak WiFi kapcsolaton keresztül töltsünk föl</string>
+ <string name="instant_video_upload_on_wifi">Videó feltöltés csak WIFI-vel</string>
<string name="instant_upload_path">/InstantUpload</string>
<string name="conflict_title">Frissítési ütközés</string>
<string name="conflict_message">%s távoli állományt nem szinkronizáltuk a helyi példánnyal. Ha folytatja, akkor a távoli állományt felülírjuk.</string>
<string name="conflict_overwrite">Felülírás</string>
<string name="conflict_dont_upload">Ne töltsük föl</string>
<string name="preview_image_description">Előnézeti kép</string>
+ <string name="preview_image_error_unknown_format">Ez a kép nem jeleníthető meg</string>
+ <string name="error__upload__local_file_not_copied">%1$s nem lehet másolni a %2$s helyi könyvtárba</string>
<string name="share_link_file_error">Hiba lépett fel a mappa megosztásakor</string>
<string name="unshare_link_file_error">Hiba lépett fel a mappa megosztásának visszavonásakor</string>
<string name="activity_chooser_send_file_title">Küldjük el</string>
<string name="saml_authentication_required_text">Felhasználóazonosítás szükséges</string>
<string name="saml_authentication_wrong_pass">Hibás jelszó</string>
<string name="move_choose_button_text">Válasszon</string>
+ <string name="prefs_category_security">Biztonság</string>
</resources>
<string name="actionbar_upload">Unggah</string>
<string name="actionbar_upload_from_apps">Konten dari apl lain</string>
<string name="actionbar_upload_files">Berkas</string>
- <string name="actionbar_open_with">Bukan dengan</string>
+ <string name="actionbar_open_with">Buka dengan</string>
<string name="actionbar_mkdir">Folder baru</string>
- <string name="actionbar_settings">pengaturan</string>
+ <string name="actionbar_settings">Pengaturan</string>
<string name="actionbar_see_details">Rincian</string>
<string name="actionbar_send_file">Kirim</string>
- <string name="prefs_category_general">umum</string>
+ <string name="prefs_category_general">Umum</string>
<string name="prefs_category_more">Lainnya</string>
<string name="prefs_accounts">Akun</string>
<string name="prefs_manage_accounts">Kelola Akun</string>
<string name="prefs_pincode">PIN Apl</string>
<string name="prefs_pincode_summary">Lindungi klien Anda</string>
+ <string name="prefs_instant_upload">Unggah gambar cepat</string>
+ <string name="prefs_instant_upload_summary">Unggah gambar yang diambil kamera dengan cepat</string>
+ <string name="prefs_instant_video_upload">Unggah video cepat</string>
+ <string name="prefs_instant_video_upload_summary">Unggah video yang direkam kamera dengan cepat</string>
<string name="prefs_log_title">Aktifkan Pencatatan</string>
<string name="prefs_log_summary">Ini digunakan untuk mencatat masalah</string>
<string name="prefs_log_title_history">Riwayat Catatan</string>
<string name="prefs_help">Bantuan</string>
<string name="prefs_recommend">Rekomendasikan ke teman</string>
<string name="prefs_feedback">Umpan balik</string>
- <string name="prefs_imprint">Imprint</string>
- <string name="recommend_subject">Coba %1$s pada smartphone Anda!</string>
+ <string name="prefs_imprint">Jejak</string>
+ <string name="recommend_subject">Cobalah %1$s pada ponsel cerdas Anda!</string>
+ <string name="recommend_text">Saya ingin mengajak Anda untuk menggunakan %1$s di ponsel cerdas Anda!\nUnduh gratis disini: %2$s</string>
<string name="auth_check_server">Periksa Server</string>
<string name="auth_host_url">Alamat server https://…</string>
<string name="auth_username">Nama Pengguna</string>
<string name="sync_string_files">Berkas</string>
<string name="setup_btn_connect">Sambungkan</string>
<string name="uploader_btn_upload_text">Unggah</string>
+ <string name="uploader_top_message">Pilih folder unggah:</string>
<string name="uploader_wrn_no_account_title">Tidak ada akun yang ditemukan</string>
<string name="uploader_wrn_no_account_text">Belum ada akun %1$s pada perangkat Anda. Silahkan buat akun terlebih dahulu.</string>
<string name="uploader_wrn_no_account_setup_btn_text">Pengaturan</string>
<string name="uploader_error_forbidden_content">%1$s tidak diizinkan mengakses konten berbagi</string>
<string name="uploader_info_uploading">Mengunggah</string>
<string name="file_list_empty">Tidak ada apa-apa di sini. Unggah sesuatu!</string>
+ <string name="file_list_loading">Memuat...</string>
+ <string name="local_file_list_empty">Tidak ada satupun berkas dalam folder ini.</string>
<string name="filedetails_select_file">Sentuh pada berkas untuk menampilkan informasi tambahan</string>
<string name="filedetails_size">Ukuran:</string>
<string name="filedetails_type">Tipe:</string>
<string name="filedetails_sync_file">Segarkan berkas</string>
<string name="filedetails_renamed_in_upload_msg">Berkas diubah namanya menjadi %1$s saat pengunggahan</string>
<string name="action_share_file">Bagikan tautan</string>
+ <string name="action_unshare_file">Batal bagikan tautan</string>
<string name="common_yes">Ya</string>
<string name="common_no">Tidak</string>
<string name="common_ok">Oke</string>
<string name="downloader_download_failed_ticker">Gagal Mengunduh</string>
<string name="downloader_download_failed_content">Mengunduh %1$s tidak selesai</string>
<string name="downloader_not_downloaded_yet">Belum diunduh</string>
+ <string name="downloader_download_failed_credentials_error">Gagal mengunduh, Anda perlu masuk kembali</string>
<string name="common_choose_account">Pilih akun</string>
<string name="sync_fail_ticker">Sinkronisasi gagal</string>
+ <string name="sync_fail_ticker_unauthorized">Sinkronisasi gagal, Anda perlu masuk kembali</string>
<string name="sync_fail_content">Sinkronisasi %1$s tidak selesai</string>
<string name="sync_fail_content_unauthorized">Sandi salah untuk %1$s</string>
<string name="sync_conflicts_in_favourites_ticker">Konflik ditemukan</string>
+ <string name="sync_conflicts_in_favourites_content">%1$d berkas kept-in-sync tidak dapat disinkronkan</string>
+ <string name="sync_fail_in_favourites_ticker">Berkas kept-in-sync gagal</string>
<string name="sync_fail_in_favourites_content">Konten berkas %1$d tidak dapat disinkronasikan (%2$d konflik)</string>
<string name="sync_foreign_files_forgotten_ticker">Beberapa berkas lokal terlupakan</string>
+ <string name="sync_foreign_files_forgotten_content">%1$d berkas diluar folder %2$s tidak dapat disalin kedalamnya</string>
+ <string name="sync_foreign_files_forgotten_explanation">Sejak versi 1.3.16, berkas-berkas yang diunggah dari piranti ini akan disalin kedalam folder %1$s lokal untuk mencagah kehilangan data ketika berkas tunggal disinkronkan dengan akun lebih dari satu.\n\nAkibat perubahan ini, semua berkas yang diunggah di versi aplikasi sebelumnya disalin kedalam folder %2$s. Namun, sebuah kesalahan mencegah penyelesaian operasi ini saat sinkronisasi berlangsung akun. Anda boleh meninggalkan berkas seperti ini dan menghapus tautan ke %3$s atau memindahkan berkas kedalam folder %1$s dan membiarkan tautan ke %4$s.\n\nYang tampak dibawah adalah berkas lokal, dan berkas remote didalam %5$s yang dihubungkan dengannya.</string>
<string name="sync_current_folder_was_removed">Folder %1$s tidak ada lagi</string>
<string name="foreign_files_move">Pindahkan semua</string>
<string name="foreign_files_success">Semua berkas sudah dipindahkan</string>
<string name="foreign_files_fail">Beberapa berkas tidak dapat dipindahkan</string>
<string name="foreign_files_local_text">Lokal: %1$s</string>
<string name="foreign_files_remote_text">Jauh: %1$s</string>
+ <string name="upload_query_move_foreign_files">Ruang tidak cukup untuk menyalin berkas terpilih kedalam folder %1$s. Apakah Anda ingin memindahkannya saja?</string>
<string name="pincode_enter_pin_code">Silakan masukkan PIN Apl</string>
<string name="pincode_configure_your_pin">Masukkan PIN Apl</string>
<string name="pincode_configure_your_pin_explanation">PIN akan selalu diminta setiap kali apl dijalankan</string>
<string name="media_notif_ticker">Pemutar musik %1$s</string>
<string name="media_state_playing">%1$s (dimainkan)</string>
<string name="media_state_loading">%1$s (sedang dimuat)</string>
+ <string name="media_event_done">%1$s pemutaran selesai</string>
<string name="media_err_nothing_to_play">Tidak ditemukan berkas media</string>
<string name="media_err_no_account">Tidak ada akun yang diberikan</string>
<string name="media_err_not_in_owncloud">Brkas tidak didalam akun yang sah</string>
<string name="media_rewind_description">Tombol mundur</string>
<string name="media_play_pause_description">Tombol main dan jeda</string>
<string name="media_forward_description">Tombol maju</string>
+ <string name="auth_getting_authorization">Mendapatkan otorisasi...</string>
<string name="auth_trying_to_login">Mencoba untuk masuk...</string>
<string name="auth_no_net_conn_title">Tidak ada koneksi internet</string>
<string name="auth_nossl_plain_ok_title">Sambungan aman tidak tersedia</string>
<string name="auth_connecting_auth_server">Menyambungkan ke server otentikasi...</string>
<string name="auth_unsupported_auth_method">Server tidak mendukung medote otentikasi ini</string>
<string name="auth_unsupported_multiaccount">%1$s tidak mendukung banyak akun </string>
+ <string name="auth_can_not_auth_against_server">Tidak dapat mengotentikasi pada server ini</string>
<string name="fd_keep_in_sync">Biarkan berkas tetap terbaru</string>
<string name="common_rename">Ubah nama</string>
<string name="common_remove">Hapus</string>
+ <string name="confirmation_remove_alert">Apakah Anda yakin ingin menghapus %1$s?</string>
+ <string name="confirmation_remove_folder_alert">Apakah Anda yakin ingin menghapus %1$s dan isinya?</string>
<string name="confirmation_remove_local">Lokal saja</string>
<string name="confirmation_remove_folder_local">Konten lokal saja</string>
<string name="confirmation_remove_remote">Hapus dari server</string>
<string name="rename_server_fail_msg">Mengubah nama tidak selesai</string>
<string name="sync_file_fail_msg">Berkas jauh tidak dapat diperiksa</string>
<string name="sync_file_nothing_to_do_msg">Isi berkas sudah diselaraskan</string>
+ <string name="create_dir_fail_msg">Folder tidak dapat dibuat</string>
<string name="filename_forbidden_characters">Karakter yang dilarang: / \\ < > : \" | ? *</string>
- <string name="wait_a_moment">Tunggu sejenak</string>
+ <string name="filename_empty">Nama berkas tidak boleh kosong</string>
+ <string name="wait_a_moment">Tunggu sebentar</string>
<string name="filedisplay_unexpected_bad_get_content">Masalah tidak terduga, silahkan pilih berkas dari apl yang berbeda</string>
<string name="filedisplay_no_file_selected">Tidak ada berkas yang terpilih</string>
+ <string name="activity_chooser_title">Kirim taukan ke</string>
<string name="oauth_check_onoff">Masuk dengan oAuth2</string>
<string name="oauth_login_connection">Menyambungkan ke server oAuth2...</string>
<string name="ssl_validator_header">Identitas situs tidak dapat diverfikasi</string>
<string name="ssl_validator_label_validity_to">Untuk:</string>
<string name="ssl_validator_label_signature">Tanda tangan:</string>
<string name="ssl_validator_label_signature_algorithm">Algoritma:</string>
+ <string name="ssl_validator_null_cert">Sertifikat tidak dapat ditampilkan.</string>
+ <string name="ssl_validator_no_info_about_error">- Tidak ada informasi tantang terror</string>
<string name="placeholder_sentence">Ini adalah placeholder</string>
<string name="placeholder_filename">placeholder.txt</string>
<string name="placeholder_filetype">Gambar PNG</string>
<string name="placeholder_timestamp">18/05/2012 12:23 PM</string>
<string name="placeholder_media_time">12:23:45</string>
<string name="instant_upload_on_wifi">Hanya unggah gambar via WiFi</string>
+ <string name="instant_video_upload_on_wifi">Hanya unggah video via WiFi</string>
<string name="instant_upload_path">/UnggahInstan</string>
<string name="conflict_title">Perbarui benturan</string>
<string name="conflict_message">Berkas jauh %s tidak sinkron dengan berkas lokal. Melanjutkan akan menggantikan konten berkas di server.</string>
<string name="conflict_overwrite">Timpa</string>
<string name="conflict_dont_upload">Jangan mengunggah</string>
<string name="preview_image_description">Pratilik gambar</string>
+ <string name="preview_image_error_unknown_format">Gambar ini tidak dapat ditampilkan</string>
<string name="activity_chooser_send_file_title">Kirim</string>
+ <string name="clipboard_text_copied">Disalin ke papan klip</string>
<string name="empty"></string>
<string name="prefs_category_accounts">Akun</string>
<string name="saml_authentication_required_text">Diperlukan otentikasi</string>
<string name="saml_authentication_wrong_pass">Sandi salah</string>
<string name="move_choose_button_text">Pilih</string>
+ <string name="prefs_category_security">Keamanan</string>
</resources>
<string name="prefs_feedback">Segnalazioni</string>
<string name="prefs_imprint">Imprint</string>
<string name="recommend_subject">Prova %1$s sul tuo smartphone!</string>
+ <string name="recommend_text">Vorrei invitarti a usare %1$s sul tuo smartphone!\nScarica qui: %2$s</string>
<string name="auth_check_server">Verifica server</string>
<string name="auth_host_url">Indirizzo server https://...</string>
<string name="auth_username">Nome utente</string>
<string name="downloader_download_file_not_found">Il file non è più disponibile sul server</string>
<string name="prefs_category_accounts">Account</string>
<string name="prefs_add_account">Aggiungi account</string>
- <string name="auth_redirect_non_secure_connection_title">La connessione sicura è rediretta attraverso un percorso non sicuro.</string>
+ <string name="actionbar_logger">Registri</string>
+ <string name="log_send_history_button">Invia cronologia</string>
+ <string name="log_mail_subject">Registri applicazione ownCloud Android</string>
+ <string name="log_progress_dialog_text">Caricamento dati...</string>
<string name="saml_authentication_required_text">Autenticazione richiesta</string>
<string name="saml_authentication_wrong_pass">Password errata</string>
<string name="actionbar_move">Sposta</string>
<string name="move_file_invalid_overwrite">Il file esiste già nella cartella di destinazione</string>
<string name="move_file_error">Si è verificato un errore durante il tentativo di spostare il file o la cartella</string>
<string name="forbidden_permissions_move">per spostare questo file</string>
+ <string name="prefs_category_security">Protezione</string>
</resources>
<string name="prefs_feedback">フィードバック</string>
<string name="prefs_imprint">インプリント</string>
<string name="recommend_subject">スマートフォンで %1$s を試してください!</string>
+ <string name="recommend_text">スマートフォンで %1$s を利用してみませんか!
+ここからダウンロードしてください: %2$s</string>
<string name="auth_check_server">サーバーを確認する</string>
<string name="auth_host_url">サーバーアドレス https://…</string>
<string name="auth_username">ユーザー名</string>
<string name="downloader_download_file_not_found">ファイルはサーバー上で利用できません</string>
<string name="prefs_category_accounts">アカウント</string>
<string name="prefs_add_account">アカウントを追加</string>
+ <string name="actionbar_logger">ログ</string>
+ <string name="log_send_history_button">ログを送信</string>
+ <string name="log_mail_subject">ownCloud Android アプリログ</string>
+ <string name="log_progress_dialog_text">読込中 ...</string>
<string name="saml_authentication_required_text">認証を必要とする</string>
<string name="saml_authentication_wrong_pass">無効なパスワード</string>
<string name="actionbar_move">移動</string>
<string name="file_list_empty_moving">ファイルが有りません。フォルダを追加してください。</string>
<string name="move_choose_button_text">選択</string>
<string name="move_file_not_found">移動できません。ファイルがあるか確認してください。</string>
+ <string name="move_file_invalid_into_descendent">フォルダを子フォルダへ移動することはできません。</string>
+ <string name="move_file_invalid_overwrite">そのファイルは、宛先フォルダに既に存在しています。</string>
<string name="move_file_error">このファイルまたはフォルダーを移動する際にエラーが発生しました</string>
<string name="forbidden_permissions_move">このファイルを移動</string>
+ <string name="prefs_category_security">セキュリティ</string>
</resources>
<string name="empty"></string>
<string name="prefs_category_accounts">ანგარიში</string>
<string name="move_choose_button_text">არჩევა</string>
+ <string name="prefs_category_security">უსაფრთხოება</string>
</resources>
<string name="prefs_category_accounts">គណនី</string>
<string name="saml_authentication_wrong_pass">ខុសពាក្យសម្ងាត់</string>
<string name="move_choose_button_text">ជ្រើស</string>
+ <string name="prefs_category_security">សុវត្ថិភាព</string>
</resources>
<string name="saml_authentication_required_text">인증 필요함</string>
<string name="saml_authentication_wrong_pass">잘못된 암호</string>
<string name="move_choose_button_text">선택</string>
+ <string name="prefs_category_security">보안</string>
</resources>
<string name="auth_host_url">Serverio adresas </string>
<string name="auth_username">Prisijungimo vardas</string>
<string name="auth_password">Slaptažodis</string>
+ <string name="auth_register">Naujas į %1$s?</string>
<string name="sync_string_files">Failai</string>
<string name="setup_btn_connect">Prisijungti</string>
<string name="uploader_btn_upload_text">Įkelti</string>
<string name="uploader_error_forbidden_content">%1$s neleidžiama prieiti prie turinio, kuriuo dalijamasi</string>
<string name="uploader_info_uploading">Išsiunčiama</string>
<string name="file_list_empty">Čia tuščia. Įkelkite ką nors!</string>
+ <string name="file_list_loading">Įkeliama ...</string>
+ <string name="local_file_list_empty">Šiame aplanke nėra failų.</string>
<string name="filedetails_select_file">Palieskite failą, kad parodyti papildomą informaciją.</string>
<string name="filedetails_size">Dydis:</string>
<string name="filedetails_type">Tipas:</string>
<string name="downloader_download_failed_credentials_error">Atsisiuntimas nepavyko, Jums reikia prisijungti pakartotinai</string>
<string name="common_choose_account">Pasirinkite paskyrą</string>
<string name="sync_fail_ticker">Sinchronizacija nepavyko</string>
+ <string name="sync_fail_ticker_unauthorized">Sinchronizacija nepavyko. Jums reikia prisijungti iš naujo</string>
<string name="sync_fail_content">%1$s sinchronizacija nepavyko</string>
<string name="sync_fail_content_unauthorized">Netinkamas slaptažodis %1$s</string>
<string name="sync_conflicts_in_favourites_ticker">Rastas konfliktas</string>
<string name="auth_connecting_auth_server">Jungiamasi prie autentikacijos serverio...</string>
<string name="auth_unsupported_auth_method">Serveris nepalaiko šio autentikacijos metodo</string>
<string name="auth_unsupported_multiaccount">%1$s nepalaiko kelių paskyrų iš karto</string>
+ <string name="auth_can_not_auth_against_server">Jungiamasi prie autentikacijos serverio...</string>
<string name="fd_keep_in_sync">Laikyti failą naujinamą</string>
<string name="common_rename">Pervadinti</string>
<string name="common_remove">Pašalinti</string>
<string name="confirmation_remove_alert">Ar tikrai norite pašalinti %1$s?</string>
+ <string name="confirmation_remove_folder_alert">Ar tikrai norite pašalinti %1$s ir ten esantį turinį?</string>
<string name="confirmation_remove_local">Tik vietiniai</string>
<string name="confirmation_remove_folder_local">Tik vietinis turinys</string>
<string name="confirmation_remove_remote">Pašalinti iš serverio</string>
<string name="sync_file_fail_msg">Nutolę failai negalėjo būti patikrinti</string>
<string name="sync_file_nothing_to_do_msg">Failo turinys jau sunchronizuotas</string>
<string name="create_dir_fail_msg">Aplanko sukurti nepavyko</string>
+ <string name="filename_forbidden_characters">Neleistini simboliai: / \\ < > : \" | ? *</string>
<string name="filename_empty">Failo pavadinimas negali būti tuščias</string>
<string name="wait_a_moment">Truputį palaukite</string>
<string name="filedisplay_unexpected_bad_get_content">Netikėta problema ; prašome pasirinkti failą iš kitos programėlės</string>
<string name="prefs_category_accounts">Paskyros</string>
<string name="saml_authentication_wrong_pass">Neteisingas slaptažodis</string>
<string name="move_choose_button_text">Pasirinkite</string>
+ <string name="prefs_category_security">Saugumas</string>
</resources>
<string name="empty"></string>
<string name="prefs_category_accounts">Konti</string>
<string name="move_choose_button_text">Izvēlieties</string>
+ <string name="prefs_category_security">Drošība</string>
</resources>
<string name="saml_authentication_required_text">Потребна е автентификација</string>
<string name="saml_authentication_wrong_pass">Погрешна лозинка</string>
<string name="move_choose_button_text">Избери</string>
+ <string name="prefs_category_security">Безбедност</string>
</resources>
--- /dev/null
+<?xml version='1.0' encoding='UTF-8'?>
+<resources>
+ <string name="empty"></string>
+</resources>
<?xml version='1.0' encoding='UTF-8'?>
<resources>
- <string name="about_android">%1$s Andriod app</string>
+ <string name="about_android">%1$s Android app</string>
<string name="about_version">versjon %1$s</string>
<string name="actionbar_sync">Oppdater konto</string>
<string name="actionbar_upload">Last opp</string>
<string name="prefs_feedback">Tilbakemelding</string>
<string name="prefs_imprint">Avtrykk</string>
<string name="recommend_subject">Prøv %1$s på smarttelefonen din!</string>
+ <string name="recommend_text">Jeg ønsker å invitere deg til å bruke %1$s på smarttelefonen din!\nLast ned her: %2$s</string>
<string name="auth_check_server">Sjekk server</string>
<string name="auth_host_url">Serveradresse https://...</string>
<string name="auth_username">Brukernavn</string>
<string name="sync_fail_in_favourites_content">Innholdet av %1$d filer kunne ikke synkroniseres (%2$d konflikter)</string>
<string name="sync_foreign_files_forgotten_ticker">Noen lokale filer ble glemt</string>
<string name="sync_foreign_files_forgotten_content">%1$d filer fra %2$s mappen kunne ikke kopieres til</string>
+ <string name="sync_foreign_files_forgotten_explanation">Fra versjon 1.3.16 blir filer som lastes opp fra denne enheten kopiert inn i den lokale mappen %1$s for å forhindre tap av data når samme fil synkroniseres med flere kontoer.\n\nPga. denne endringen ble alle filer som er blitt lastet opp med tidligere versjoner av denne appen, kopiert til mappe %2$s. Imidlertid kunne ikke denne kopieringen fullføres under konto-synkroniseringen pga. en feil. Du kan enten la filen(e) ligge der de ligger og fjerne lenken til %3$s, eller flytte filene til mappe %1$s og beholde lenken til %4$s.\n\nNedenfor finner du en liste over de lokale filene og de eksterne filene i %5$s som de var lenket til.</string>
<string name="sync_current_folder_was_removed">Mappen %1$s finnes ikke lengere</string>
<string name="foreign_files_move">Flytt alle</string>
<string name="foreign_files_success">Alle filer ble flyttet</string>
<string name="error__upload__local_file_not_copied">%1$s kunne ikke kopieres til lokal mappe %2$s</string>
<string name="share_link_no_support_share_api">Beklager, deling er ikke skrudd på for din tjener. Ta kontakt med
administratoren.</string>
+ <string name="share_link_file_no_exist">Kan ikke dele. Sjekk om filen eksisterer.</string>
<string name="share_link_file_error">Det skjedde en feil under deling av denne filen eller mappen</string>
+ <string name="unshare_link_file_no_exist">Kan ikke fjerne deling. Sjekk om filen eksisterer.</string>
<string name="unshare_link_file_error">En feil oppstod ved avslutting av delingen av denne filen eller mappen</string>
<string name="activity_chooser_send_file_title">Send</string>
<string name="copy_link">Kopier lenke</string>
<string name="downloader_download_file_not_found">Filen finnes ikke på serveren lenger</string>
<string name="prefs_category_accounts">Kontoer</string>
<string name="prefs_add_account">Legg til en konto</string>
- <string name="auth_redirect_non_secure_connection_title">Sikker tilkobling videresendes gjennom en usikker rute.</string>
+ <string name="actionbar_logger">Logger</string>
+ <string name="log_send_history_button">Send historikk</string>
+ <string name="log_mail_subject">logger for ownCloud Android app</string>
+ <string name="log_progress_dialog_text">Laster data...</string>
<string name="saml_authentication_required_text">Autentisering kreves</string>
<string name="saml_authentication_wrong_pass">Feil passord</string>
+ <string name="actionbar_move">Flytt</string>
+ <string name="file_list_empty_moving">Ingenting her. Du kan legge til en mappe!</string>
<string name="move_choose_button_text">Velg</string>
+ <string name="move_file_not_found">Kan ikke flytte. Sjekk om filen eksisterer.</string>
+ <string name="move_file_invalid_into_descendent">Det er ikke mulig å flytte en mappe inn i sin egen undermappe</string>
+ <string name="move_file_invalid_overwrite">Filen finnes allerede i målmappen</string>
+ <string name="move_file_error">En feil oppstod ved flytting av denne filen eller mappen</string>
+ <string name="forbidden_permissions_move">å flytte denne filen</string>
+ <string name="prefs_category_security">Sikkerhet</string>
</resources>
<string name="preview_image_description">Afbeelding voorbeeld</string>
<string name="preview_image_error_unknown_format">Deze afbeelding kan niet worden getoond</string>
<string name="error__upload__local_file_not_copied">%1$s kon niet worden gekopieerd naar de %2$s lokale map</string>
+ <string name="prefs_instant_upload_path_title">Upload pad</string>
<string name="share_link_no_support_share_api">Sorry, delen is niet mogelijk op uw server. Neem contact op met uw
beheerder.</string>
<string name="share_link_file_no_exist">Kan dit niet delen. Controleer of dit bestand wel bestaat.</string>
<string name="downloader_download_file_not_found">Dit bestand is niet langer beschikbaar op de server</string>
<string name="prefs_category_accounts">Accounts</string>
<string name="prefs_add_account">Toevoegen account</string>
- <string name="auth_redirect_non_secure_connection_title">De beveiligde verbinding is omgeleid via een onveilige route.</string>
+ <string name="auth_redirect_non_secure_connection_title">De beveiligde verbinding is omgeleid naar een onveilige route.</string>
+ <string name="actionbar_logger">Logs</string>
+ <string name="log_send_history_button">Verstuur geschiedenis</string>
+ <string name="log_mail_subject">ownCloud Android app logs</string>
+ <string name="log_progress_dialog_text">Laden data...</string>
<string name="saml_authentication_required_text">Authenticatie vereist</string>
<string name="saml_authentication_wrong_pass">Onjuist wachtwoord</string>
<string name="actionbar_move">verplaatsen</string>
<string name="move_file_invalid_overwrite">Het bestand bestaat al in de doelmap</string>
<string name="move_file_error">Er trad een fout op bij uw poging dit bestand of deze map te verplaatsen</string>
<string name="forbidden_permissions_move">om dit bestand te verplaatsen</string>
+ <string name="prefs_category_instant_uploading">Directe uploads</string>
+ <string name="prefs_category_security">Beveiliging</string>
</resources>
<string name="prefs_category_accounts">Kontoar</string>
<string name="saml_authentication_wrong_pass">Feil passord</string>
<string name="move_choose_button_text">Vel</string>
+ <string name="prefs_category_security">Tryggleik</string>
</resources>
<string name="prefs_feedback">Wsparcie</string>
<string name="prefs_imprint">Stopka</string>
<string name="recommend_subject">Wypróbuj %1$s na swoim smartphonie!</string>
+ <string name="recommend_text">Chciałbym zaprosić Cię do używania %1$s na swoim smartfonie!\nŚciągnij tutaj: %2$s</string>
<string name="auth_check_server">Sprawdź serwer</string>
<string name="auth_host_url">Adres serwera https://...</string>
<string name="auth_username">Nazwa użytkownika</string>
<string name="sync_fail_in_favourites_content">Zawartość %1$d plików nie może zostać synchronizowana (%2$d konfliktów)</string>
<string name="sync_foreign_files_forgotten_ticker">Niektóre lokalne pliki zostały zgubione.</string>
<string name="sync_foreign_files_forgotten_content">%1$d plików z folderu %2$s nie udało się się przekopiować</string>
+ <string name="sync_foreign_files_forgotten_explanation">Od wersji 1.3.16, pliki wysyłane z tego urządzenia są kopiowane do lokalnego folderu %1$s aby zapobiec utracie danych gdy pojedynczy plik jest synchronizowany z wieloma kontami.\n\nZ powodu tej zmiany, wszystkie pliki wysłane za pomocą poprzedniej wersji tej aplikacji były kopiowane do folderu %2$s. Jednakże, błąd uniemożliwiał dokończenie tej operacji podczas synchronizacji konta. Możesz albo pozostawić plik(i) tak jak jest i usunąć link do %3$s lub przenieść plik(i) do folderu %1$s i pozostawić link do %4$s.\n\nPoniżej plik(i) lokalny i plik(i) zdalny w %5$s, do którego zostały zlinkowane.</string>
<string name="sync_current_folder_was_removed">Folder %1$s nie istnieje.</string>
<string name="foreign_files_move">Przenieś wszystko</string>
<string name="foreign_files_success">Wszystkie pliki zostały przeniesione</string>
<string name="error__upload__local_file_not_copied">%1$s nie może zostać skopiowany do lokalnego folderu %2$s</string>
<string name="share_link_no_support_share_api">Przepraszamy, ale współdzielenie nie jest włączone na Twoim serwerze. Proszę skontaktuj się z
administratorem.</string>
+ <string name="share_link_file_no_exist">Nie można udostępnić. Proszę sprawdzić, czy plik istnieje</string>
<string name="share_link_file_error">Wystąpił błąd podczas udostępniania tego pliku lub folderu.</string>
+ <string name="unshare_link_file_no_exist">Nie można wyłączyć udostępniania. Proszę sprawdzić, czy plik istnieje</string>
<string name="unshare_link_file_error">Wystąpił błąd podczas anulowania udostępniania tego pliku lub folderu.</string>
<string name="activity_chooser_send_file_title">Wyślij</string>
<string name="copy_link">Skopiuj link</string>
<string name="downloader_download_file_not_found">Ten plik nie jest już dostępny na serwerze</string>
<string name="prefs_category_accounts">Konta</string>
<string name="prefs_add_account">Dodaj konto</string>
- <string name="auth_redirect_non_secure_connection_title">Bezpieczne połączenie jest przekierowywane przez niezabezpieczone trasy.</string>
+ <string name="actionbar_logger">Logi</string>
+ <string name="log_send_history_button">Wyślij historię</string>
+ <string name="log_progress_dialog_text">Ładuję dane...</string>
<string name="saml_authentication_required_text">Wymagana autoryzacja</string>
<string name="saml_authentication_wrong_pass">Złe hasło</string>
+ <string name="actionbar_move">Przenieś</string>
+ <string name="file_list_empty_moving">Nic tu nie ma. Możesz dodać folder!</string>
<string name="move_choose_button_text">Wybierz</string>
+ <string name="move_file_not_found">Nie można przenieść. Proszę sprawdzić, czy plik istnieje</string>
+ <string name="move_file_invalid_into_descendent">Nie jest możliwe przeniesienie folderu do potomka</string>
+ <string name="move_file_invalid_overwrite">Plik istnieje już w folderze docelowym</string>
+ <string name="move_file_error">Pojawił się błąd podczas próby przeniesienia tego pliku lub folderu</string>
+ <string name="forbidden_permissions_move">aby przenieść ten plik</string>
+ <string name="prefs_category_security">Bezpieczeństwo</string>
</resources>
<string name="preview_image_description">Pré-visualização da imagem</string>
<string name="preview_image_error_unknown_format">Esta imagem não pode ser mostrada</string>
<string name="error__upload__local_file_not_copied">%1$s não pôde ser copiado para pasta local %2$s</string>
+ <string name="prefs_instant_upload_path_title">Enviar Caminho</string>
<string name="share_link_no_support_share_api">Desculpe, o compartilhamento não está habilitado em seu servidor. Entre em contato com seu
⇥⇥ administrador.</string>
<string name="share_link_file_no_exist">Não é possível compartilhar. Por favor verifique se o arquivo existe</string>
<string name="downloader_download_file_not_found">Este arquivo não mais está disponível neste servidor</string>
<string name="prefs_category_accounts">Contas</string>
<string name="prefs_add_account">Adicionar uma conta</string>
- <string name="auth_redirect_non_secure_connection_title">A conexão segura está redirecionada através de uma rota insegura.</string>
+ <string name="auth_redirect_non_secure_connection_title">Conexão segura esta redirecionada para uma rota não segura.</string>
+ <string name="actionbar_logger">Logs</string>
+ <string name="log_send_history_button">Enviar Histórico</string>
+ <string name="log_mail_subject">Logs do aplicativo ownCloud Android</string>
+ <string name="log_progress_dialog_text">Carregamento de dados...</string>
<string name="saml_authentication_required_text">Autenticação é requerida</string>
<string name="saml_authentication_wrong_pass">Senha incorreta</string>
<string name="actionbar_move">Mover</string>
<string name="move_file_invalid_overwrite">O arquivo já existe na pasta de destino</string>
<string name="move_file_error">Ocorreu um erro ao tentar mover este arquivo ou pasta</string>
<string name="forbidden_permissions_move">mover este arquivo</string>
+ <string name="prefs_category_instant_uploading">Envios Instantâneos</string>
+ <string name="prefs_category_security">Segurança</string>
</resources>
<string name="prefs_feedback">Resposta</string>
<string name="prefs_imprint">Imprint</string>
<string name="recommend_subject">Experimente %1$s no seu smartphone!</string>
+ <string name="recommend_text">Quero convidar-te a usares %1$s no teu smartphone!\nFaz download aqui: %2$s</string>
<string name="auth_check_server">Verificar Servidor</string>
<string name="auth_host_url">Endereço do servidor https://..</string>
<string name="auth_username">Nome de Utilizador</string>
<string name="preview_image_description">Pré-Visualização da imagem</string>
<string name="preview_image_error_unknown_format">Esta imagem não pode ser mostrada</string>
<string name="error__upload__local_file_not_copied">Não foi possível copiar %1$s para a pasta local %2$s</string>
+ <string name="prefs_instant_upload_path_title">Caminho de Upload</string>
<string name="share_link_no_support_share_api">Lamentamos mas não é possível partilhar através do seu servidor. Por favor contacte o seu administrador.</string>
<string name="share_link_file_no_exist">Não é possivel partilhar. Por favor verifique se o ficheiro existe</string>
<string name="share_link_file_error">Ocorreu um erro enquanto tentava partilhar este ficheiro ou pasta</string>
+ <string name="unshare_link_file_no_exist">Não é possível retirar a partilha. Verifique se o ficheiro existe</string>
<string name="unshare_link_file_error">Ocorreu um erro enquanto retirava a partilha deste ficheiro ou pasta</string>
<string name="activity_chooser_send_file_title">Enviar</string>
<string name="copy_link">Copiar ligação</string>
<string name="downloader_download_file_not_found">O ficheiro não está mais disponível no servidor</string>
<string name="prefs_category_accounts">Contas</string>
<string name="prefs_add_account">Adicionar conta</string>
- <string name="auth_redirect_non_secure_connection_title">Uma ligação segura foi redireccionada por uma rota insegura.</string>
+ <string name="auth_redirect_non_secure_connection_title">Ligação segura é redireccionada para um caminho inseguro.</string>
+ <string name="actionbar_logger">Logs</string>
+ <string name="log_send_history_button">Enviar Histórico</string>
+ <string name="log_mail_subject">Logs da app ownCloud Android</string>
+ <string name="log_progress_dialog_text">A carregar os dados...</string>
<string name="saml_authentication_required_text">Autenticação necessária</string>
<string name="saml_authentication_wrong_pass">Password errada</string>
<string name="actionbar_move">Mover</string>
<string name="file_list_empty_moving">Não está aqui nada. Pode adicionar uma pasta!</string>
<string name="move_choose_button_text">Escolha</string>
+ <string name="move_file_not_found">Não é possível mover. Verifique se o ficheiro existe</string>
+ <string name="move_file_invalid_into_descendent">Não é possível mover esta pasta deste modo</string>
+ <string name="move_file_invalid_overwrite">O ficheiro já existe na pasta de destino</string>
+ <string name="move_file_error">Um erro ocorreu ao tentar mover este ficheiro ou pasta</string>
<string name="forbidden_permissions_move">para mover este ficheiro</string>
+ <string name="prefs_category_instant_uploading">Uploads Instantâneos</string>
+ <string name="prefs_category_security">Segurança</string>
</resources>
<string name="prefs_category_accounts">Conturi</string>
<string name="saml_authentication_wrong_pass">Parolă greșită</string>
<string name="move_choose_button_text">Alege</string>
+ <string name="prefs_category_security">Securitate</string>
</resources>
<string name="prefs_feedback">Обратная связь</string>
<string name="prefs_imprint">Штамп</string>
<string name="recommend_subject">Попробуйте %1$s на вашем смартфоне!</string>
+ <string name="recommend_text">Хочу предложить вам использовать %1$s на смартфоне!\nЗагрузить можно здесь: %2$s
+ </string>
<string name="auth_check_server">Проверить сервер</string>
<string name="auth_host_url">Адрес сервера https://...</string>
<string name="auth_username">Имя пользователя</string>
<string name="preview_image_error_unknown_format">Это изображение не может быть отображено</string>
<string name="error__upload__local_file_not_copied">%1$s не возможно скопировать в локальною папку %2$s </string>
<string name="share_link_no_support_share_api">К сожалению, на вашем сервере отключен совместный доступ. Пожалуйста, свяжитесь с вашим администратором.</string>
+ <string name="share_link_file_no_exist">Невозможно добавить в общий доступ. Пожалуйста, проверьте, существует ли файл</string>
<string name="share_link_file_error">Ошибка предоставления общего доступа к этому файлу или каталогу</string>
+ <string name="unshare_link_file_no_exist">Невозможно убрать из общего доступа. Пожалуйста, проверьте, существует ли файл</string>
<string name="unshare_link_file_error">Ошибка удаления общего доступа к этому файлу или каталогу</string>
<string name="activity_chooser_send_file_title">Отправить</string>
<string name="copy_link">Копировать ссылку</string>
<string name="downloader_download_file_not_found">Этот файл больше недоступен на сервере</string>
<string name="prefs_category_accounts">Учётные записи</string>
<string name="prefs_add_account">Добавить учетную запись</string>
- <string name="auth_redirect_non_secure_connection_title">Безопасное соединение перенаправлено через небезопасный маршрут.</string>
+ <string name="actionbar_logger">Журналы</string>
+ <string name="log_send_history_button">История Отправлений</string>
+ <string name="log_mail_subject">Журналы Андроид-приложения ownCloud</string>
+ <string name="log_progress_dialog_text">Загружаются данные...</string>
<string name="saml_authentication_required_text">Требуется аутентификация </string>
<string name="saml_authentication_wrong_pass">Неправильный пароль</string>
<string name="actionbar_move">Переместить</string>
+ <string name="file_list_empty_moving">Здесь ничего нет. Вы можете добавить папку!</string>
<string name="move_choose_button_text">Выбрать</string>
+ <string name="move_file_not_found">Невозможно переместить. Пожалуйста, проверьте, существует ли файл</string>
+ <string name="move_file_invalid_into_descendent">Невозможно переместить папку в папку-потомок</string>
+ <string name="move_file_invalid_overwrite">Файл уже существует в папке назначения</string>
+ <string name="move_file_error">Произошла ошибка при попытке перемещения этого файла или папки</string>
+ <string name="forbidden_permissions_move">переместить этот файл</string>
+ <string name="prefs_category_security">Безопасность</string>
</resources>
<string name="downloader_download_file_not_found">Súbor už na serveri nie je dostupný</string>
<string name="prefs_category_accounts">Účty</string>
<string name="prefs_add_account">Pridať účet</string>
- <string name="auth_redirect_non_secure_connection_title">Zabezpečené spojenie je presmerované nezabezpečenou cestou.</string>
<string name="saml_authentication_required_text">Vyžaduje sa overenie</string>
<string name="saml_authentication_wrong_pass">Nesprávne heslo</string>
<string name="actionbar_move">Presunúť</string>
<string name="move_choose_button_text">Vybrať</string>
+ <string name="prefs_category_security">Zabezpečenie</string>
</resources>
<string name="prefs_feedback">Odziv</string>
<string name="prefs_imprint">Natis</string>
<string name="recommend_subject">Preizkusi %1$s na pametnem telefonu!</string>
+ <string name="recommend_text">Želim ti predstaviti %1$s na pametnem telefonu!\nPrejmeš ga lahko na: %2$s</string>
<string name="auth_check_server">Preveri strežnik</string>
<string name="auth_host_url">Naslov strežnika https://…</string>
<string name="auth_username">Uporabniško ime</string>
<string name="sync_fail_in_favourites_content">Vsebine %1$d datotek ni bilo mogoče uskladiti (zaznanih je %2$d sporov)</string>
<string name="sync_foreign_files_forgotten_ticker">Nekatere krajevne datoteke so spregledane</string>
<string name="sync_foreign_files_forgotten_content">Skupno %1$d datotek iz mape %2$s ni mogoče kopirati v</string>
+ <string name="sync_foreign_files_forgotten_explanation">Od različice 1.3.16 so datoteke, poslane iz te naprave, varnostno kopirane v krajevno mapo %1$s. S tem je preprečena možnost izgube podatkov, ko se ena datoteka usklajuje z več računi.\n\nZaradi te spremembe so vse datoteke, ki so bile kopirane v prejšnjih različicah, kopirane v mapo %2$s. Zaradi napake ni mogoče končati usklajevanja. Datoteke lahko ali pustite kjer so, in odstranite povezavo na %3$s, ali pa premaknete datoteke v mapo %1$s in ohranite povezavo do %4$s.\n\nSpodaj so izpisane krajevne datoteke in oddaljene povezane datoteke v mapi %5$s.</string>
<string name="sync_current_folder_was_removed">Mapa %1$s ne obstaja več</string>
<string name="foreign_files_move">Premakni vse</string>
<string name="foreign_files_success">Vse datoteke so uspešno premaknjene na novo mesto</string>
<string name="error__upload__local_file_not_copied">Datoteke %1$s ni mogoče kopirati v krajevno mapo %2$s</string>
<string name="share_link_no_support_share_api">Souporaba je na strežniku onemogočena. Možnost lahko spreminjajo le
uporabniki s skrbniškimi dovoljenji.</string>
+ <string name="share_link_file_no_exist">Souporaba ni mogoča. Preverite, ali datoteka obstaja.</string>
<string name="share_link_file_error">Prišlo je do napake med poskusom omogočanja souporabe te datoteke ali mape</string>
+ <string name="unshare_link_file_no_exist">Ni mogoče prekiniti souporabe. Preverite, ali datoteka obstaja.</string>
<string name="unshare_link_file_error">Prišlo je do napake med poskusom odstranjevanja souporabe te datoteke ali mape</string>
<string name="activity_chooser_send_file_title">Pošlji</string>
<string name="copy_link">Kopiraj povezavo</string>
<string name="downloader_download_file_not_found">Datoteka na strežniku ni več na voljo.</string>
<string name="prefs_category_accounts">Računi</string>
<string name="prefs_add_account">Dodaj račun</string>
- <string name="auth_redirect_non_secure_connection_title">Varna povezava je preusmerjena preko ne-varne poti.</string>
+ <string name="actionbar_logger">Dnevnik</string>
+ <string name="log_send_history_button">Pošlji zgodovino</string>
+ <string name="log_mail_subject">Dnevnik programa ownCloud</string>
+ <string name="log_progress_dialog_text">Poteka nalaganje podatkov ...</string>
<string name="saml_authentication_required_text">Zahtevana je overitev</string>
<string name="saml_authentication_wrong_pass">Napačno geslo</string>
<string name="actionbar_move">Premakni</string>
+ <string name="file_list_empty_moving">Ni vsebine in datotek. Lahko ustvarite na primer mapo.</string>
<string name="move_choose_button_text">Izbor</string>
+ <string name="move_file_not_found">Ni mogoče premakniti datoteke. Preverite, ali obstaja.</string>
+ <string name="move_file_invalid_into_descendent">Ni mogoče premakniti mape v podrejeno mapo.</string>
+ <string name="move_file_invalid_overwrite">Datoteka v ciljni mapi že obstaja.</string>
+ <string name="move_file_error">Prišlo je do napake med premikanjem datoteke v mapo</string>
+ <string name="forbidden_permissions_move">med premikanjem datoteke</string>
+ <string name="prefs_category_security">Varnost</string>
</resources>
<string name="prefs_category_accounts">Llogarit</string>
<string name="saml_authentication_wrong_pass">Fjalëkalim i gabuar</string>
<string name="move_choose_button_text">Zgjidh</string>
+ <string name="prefs_category_security">Siguria</string>
</resources>
<string name="empty"></string>
<string name="prefs_category_accounts">Налози</string>
<string name="move_choose_button_text">Одабери</string>
+ <string name="prefs_category_security">Безбедност</string>
</resources>
<string name="prefs_recommend">Rekommendera till en vän</string>
<string name="prefs_feedback">Feedback</string>
<string name="prefs_imprint">Imprint</string>
- <string name="recommend_subject">Försök %1$s på din smarttelefon!</string>
+ <string name="recommend_subject">Prova %1$s på din smartphone!</string>
+ <string name="recommend_text">Jag skullje vilja bjuda in dig till att prova %1$s på din smartphone!\nLadda ner appen från Google Play här: %2$s</string>
<string name="auth_check_server">Kontrollera Server</string>
<string name="auth_host_url">Serveradress https://...</string>
<string name="auth_username">Användarnamn</string>
<string name="uploader_info_uploading">Laddar upp</string>
<string name="file_list_empty">Ingenting här. Ladda upp något!</string>
<string name="file_list_loading">Laddar...</string>
+ <string name="local_file_list_empty">Det finns inga filer i den här mappen.</string>
<string name="filedetails_select_file">Peka på en fil för att visa mer information.</string>
<string name="filedetails_size">Storlek:</string>
<string name="filedetails_type">Typ:</string>
<string name="downloader_download_failed_credentials_error">Nerladda misslyckades, måste du logga in igen</string>
<string name="common_choose_account">Välj konto</string>
<string name="sync_fail_ticker">Synkroniseringen misslyckades</string>
+ <string name="sync_fail_ticker_unauthorized">Synkroniseringen misslyckades, du måste logga in på nytt.</string>
<string name="sync_fail_content">Synkronisering av %1$s kunde inte slutföras</string>
<string name="sync_fail_content_unauthorized">Felaktigt lösenord för %1$s</string>
<string name="sync_conflicts_in_favourites_ticker">Konflikter uppstod</string>
<string name="network_error_connect_timeout_exception">Ett fel uppstod i väntan på servern, operationen kunde inte ha gjorts</string>
<string name="network_host_not_available">Åtgärden kunte inte slutföras, servern är ej tillgänglig</string>
<string name="empty"></string>
+ <string name="forbidden_permissions">Du har inga rättigheter %s</string>
+ <string name="forbidden_permissions_rename">att döpa om denna fil</string>
+ <string name="forbidden_permissions_delete">att radera denna fil</string>
+ <string name="share_link_forbidden_permissions">att dela denna fil</string>
+ <string name="unshare_link_forbidden_permissions">att avbryta delningen utav denna fil</string>
+ <string name="forbidden_permissions_create">att skapa filen</string>
+ <string name="uploader_upload_forbidden_permissions">att ladda upp i den här mappen</string>
+ <string name="downloader_download_file_not_found">Filen är inte längre tillgänglig på servern</string>
<string name="prefs_category_accounts">Konton</string>
+ <string name="prefs_add_account">Lägg till konto</string>
+ <string name="log_progress_dialog_text">Laddar data...</string>
<string name="saml_authentication_required_text">Autentisering krävs</string>
<string name="saml_authentication_wrong_pass">Fel lösenord</string>
+ <string name="actionbar_move">Flytta</string>
+ <string name="file_list_empty_moving">Ingenting här. Du kan skapa en mapp!</string>
<string name="move_choose_button_text">Välj</string>
+ <string name="move_file_not_found">Gick inte att flytta. Vänligen kontrollera att filen existerar</string>
+ <string name="forbidden_permissions_move">att flytta den här filen</string>
+ <string name="prefs_category_security">Säkerhet</string>
</resources>
--- /dev/null
+<?xml version='1.0' encoding='UTF-8'?>
+<resources>
+ <string name="empty"></string>
+</resources>
<string name="preview_image_description">Resim önizleme</string>
<string name="preview_image_error_unknown_format">Bu resim gösterilemiyor</string>
<string name="error__upload__local_file_not_copied">%1$s, %2$s yerel klasörüne kopyalanamadı</string>
+ <string name="prefs_instant_upload_path_title">Yükleme Yolu</string>
<string name="share_link_no_support_share_api">Üzgünüz, paylaşım sunucunuzda etkin değil. Lütfen yöneticinizle
iletişime geçin.</string>
<string name="share_link_file_no_exist">Paylaşma başarısız. Lütfen dosyanın mevcut olup olmadığını denetleyin</string>
<string name="downloader_download_file_not_found">Bu dosya artık sunucuda mevcut değil</string>
<string name="prefs_category_accounts">Hesaplar</string>
<string name="prefs_add_account">Hesap ekle</string>
- <string name="auth_redirect_non_secure_connection_title">Güvenli bağlantı, güvenli olmayan bir rotaya yönlendiriliyor.</string>
+ <string name="auth_redirect_non_secure_connection_title">Güvenli bağlantı, güvenli olmayan bir rotaya yönlendirildi.</string>
+ <string name="actionbar_logger">Günlükler</string>
+ <string name="log_send_history_button">Geçmişi Gönder</string>
+ <string name="log_mail_subject">ownCloud Android uygulama kayıtları</string>
+ <string name="log_progress_dialog_text">Veri yükleniyor...</string>
<string name="saml_authentication_required_text">Kimlik doğrulama gerekli</string>
<string name="saml_authentication_wrong_pass">Hatalı parola</string>
<string name="actionbar_move">Taşı</string>
<string name="move_file_invalid_overwrite">Dosya zaten hedef klasörde mevcut</string>
<string name="move_file_error">Bu dosya veya klasörü taşımaya çalışılırken bir hata oluştu</string>
<string name="forbidden_permissions_move">bu dosyayı taşımak için</string>
+ <string name="prefs_category_instant_uploading">Anında Yüklemeler</string>
+ <string name="prefs_category_security">Güvenlik</string>
</resources>
<string name="activity_chooser_send_file_title">يوللا</string>
<string name="empty"></string>
<string name="prefs_category_accounts">ھېساباتلار</string>
+ <string name="prefs_category_security">بىخەتەرلىك</string>
</resources>
<?xml version='1.0' encoding='UTF-8'?>
<resources>
+ <string name="about_android">%1$s Android App</string>
+ <string name="about_version">версія %1$s</string>
+ <string name="actionbar_sync">Оновити account</string>
<string name="actionbar_upload">Відвантажити</string>
<string name="actionbar_upload_from_apps">Вміст із інших програм</string>
<string name="actionbar_upload_files">Файли</string>
+ <string name="actionbar_open_with">Відкрити за допомогою</string>
<string name="actionbar_mkdir">Нова тека</string>
<string name="actionbar_settings">Налаштування</string>
<string name="actionbar_see_details">Деталі</string>
<string name="prefs_manage_accounts">Управління обліковими записами</string>
<string name="prefs_pincode">App програмний PIN</string>
<string name="prefs_pincode_summary">Захист Вашог App клієнта</string>
+ <string name="prefs_instant_upload">Миттєві зображення</string>
+ <string name="prefs_instant_upload_summary">Миттєві зображення з камери</string>
+ <string name="prefs_instant_video_upload">Миттєві відео</string>
+ <string name="prefs_instant_video_upload_summary">Миттєві відео з камери</string>
+ <string name="prefs_log_title">Ввімкнути журнал</string>
+ <string name="prefs_log_summary">Використовується для реєстрації помилок</string>
+ <string name="prefs_log_title_history">Журнал</string>
+ <string name="prefs_log_summary_history">Тут показані записи журналу</string>
+ <string name="prefs_log_delete_history_button">Видалити історію записів</string>
<string name="prefs_help">Допомога</string>
+ <string name="prefs_recommend">Порадити товаришу</string>
<string name="prefs_feedback">Зворотній зв\'язок</string>
<string name="prefs_imprint">Відбиток</string>
+ <string name="recommend_subject">Спробуйте %1$s на своєму смартфоні!</string>
+ <string name="recommend_text">Пропоную вам користуватися %1$s на вашому смартфоні!\nЗавантажити можна за посиланням: %2$s</string>
+ <string name="auth_check_server">Перевірити сервер</string>
+ <string name="auth_host_url">Адреса серверу https://…</string>
<string name="auth_username">Ім\'я користувача</string>
<string name="auth_password">Пароль</string>
+ <string name="auth_register">Вперше в %1$s?</string>
<string name="sync_string_files">Файли</string>
<string name="setup_btn_connect">З\'єднати</string>
<string name="uploader_btn_upload_text">Відвантажити</string>
+ <string name="uploader_top_message">Оберіть теку для завантаження:</string>
<string name="uploader_wrn_no_account_title">Не знайдено облікового запису</string>
<string name="uploader_wrn_no_account_text">На Вашому пристрої відсутні облікові записи %1$s. Будь ласка, спочатку створіть запис.</string>
<string name="uploader_wrn_no_account_setup_btn_text">Налаштування</string>
<string name="uploader_error_forbidden_content">%1$s не може отримати доступ до спільного контенту</string>
<string name="uploader_info_uploading">Завантаження</string>
<string name="file_list_empty">Тут нічого немає. Відвантажте що-небудь!</string>
+ <string name="file_list_loading">Завантаження...</string>
+ <string name="local_file_list_empty">В цій теці немає файлів.</string>
<string name="filedetails_select_file">Натисніть на файлі для відображення додаткової інформації</string>
<string name="filedetails_size">Розмір:</string>
<string name="filedetails_type">Тип:</string>
<string name="filedetails_created">Створено:</string>
<string name="filedetails_modified">Змінено:</string>
<string name="filedetails_download">Завантажити</string>
+ <string name="filedetails_sync_file">Оновити файл</string>
<string name="filedetails_renamed_in_upload_msg">Файл був переіменований в %1$s протягом вивантаження</string>
<string name="action_share_file">Опублікувати посилання</string>
+ <string name="action_unshare_file">Видалити посилання</string>
<string name="common_yes">Так</string>
<string name="common_no">Ні</string>
<string name="common_ok">OK</string>
<string name="common_cancel">Відмінити</string>
<string name="common_save_exit">Зберегти & Вихід</string>
<string name="common_error">Помилка</string>
+ <string name="common_loading">Завантаження...</string>
<string name="common_error_unknown">Невідома помилка</string>
<string name="about_title">Про</string>
<string name="change_password">Змінити пароль</string>
<string name="uploader_upload_succeeded_content_single">%1$s було успішно завантажено</string>
<string name="uploader_upload_failed_ticker">Помилка завантаження</string>
<string name="uploader_upload_failed_content_single">Завантаження %1$s не може завершитись</string>
+ <string name="uploader_upload_failed_credentials_error">Завантажити не вдалося, необхідно повторити вхід</string>
<string name="downloader_download_in_progress_ticker">Зкачування …</string>
<string name="downloader_download_in_progress_content">%1$d%% Зкачування %2$s</string>
<string name="downloader_download_succeeded_ticker">Успішно зкачано</string>
<string name="downloader_download_succeeded_content">%1$s успішно завантажено</string>
<string name="downloader_download_failed_ticker">Завантаження не вдалося</string>
<string name="downloader_download_failed_content">Завантаження %1$s не вдається завершити</string>
+ <string name="downloader_not_downloaded_yet">Ще не завантажене</string>
+ <string name="downloader_download_failed_credentials_error">Зберегти не вдалося, необхідно повторити вхід</string>
<string name="common_choose_account">Оберіть обліковий запис</string>
<string name="sync_fail_ticker">Помилка синхронізації</string>
+ <string name="sync_fail_ticker_unauthorized">Синхронізація не вдалася, необхідно повторити вхід</string>
<string name="sync_fail_content">Синхронізація %1$s не вдалась</string>
+ <string name="sync_fail_content_unauthorized">Невірний пароль для %1$s</string>
<string name="sync_conflicts_in_favourites_ticker">Конфліктів знайдено</string>
<string name="sync_conflicts_in_favourites_content">%1$d файли, які мають бути синхронізованими не можуть синхронізуватися</string>
<string name="sync_fail_in_favourites_ticker">Синхронізувати файли не вдалося</string>
<string name="sync_fail_in_favourites_content">Зміст %1$d файлів не може бути синхронізований (%2$d конфліктів)</string>
<string name="sync_foreign_files_forgotten_ticker">Деякі локальні файли були забуті</string>
+ <string name="sync_foreign_files_forgotten_content">Неможливо скопіювати %1$d файли з теки %2$s</string>
+ <string name="sync_foreign_files_forgotten_explanation">\"Починаючи з версії 1.3.16, файли, завантажені з цього пристрою копіюються в локальну теку %1$s для запобігання втрати даних під час синхронізації одного файлу з кількома обліковими записами.\n\nТому всі файли, завантажені в попередніх версіях цього додатку були скопійовані в теку %2$s. Однак, під час синхронізації сталася помилка. Ви можете залишити файл(и) як є та видалити посилання на %3$s, або перемістити файл(и) в директорію %1$s і зберегти посилання на %4$s.\n\nНижче наведені локальні та віддалені файли у %5$s з якою вони були пов\'язані.</string>
+ <string name="sync_current_folder_was_removed">Тека %1$s білше не існує</string>
<string name="foreign_files_move">Перемістити все</string>
<string name="foreign_files_success">Всі файли були переміщені</string>
<string name="foreign_files_fail">Деякі файли не можуть бути переміщені</string>
<string name="foreign_files_local_text">Локально: %1$s</string>
<string name="foreign_files_remote_text">Віддалено: %1$s</string>
+ <string name="upload_query_move_foreign_files">Недостатньо місця для копіювання обраних файлів у теку %1$s. Чи бажаєте ви перемістити їх замість копіювання?</string>
<string name="pincode_enter_pin_code">Будь ласка, введіть свій програмний PIN</string>
<string name="pincode_configure_your_pin">Введіть програмний PIN</string>
<string name="pincode_configure_your_pin_explanation">PIN необхідно буде вводити щоразу при запуску цієї програми</string>
<string name="pincode_wrong">Не вірний App програмний PIN</string>
<string name="pincode_removed">App програмний PIN видалено</string>
<string name="pincode_stored">App програмний PIN збережено</string>
+ <string name="media_notif_ticker">%1$s музичний плеєр</string>
+ <string name="media_state_playing">%1$s (відтворення)</string>
+ <string name="media_state_loading">%1$s (завантаження)</string>
+ <string name="media_event_done">%1$s відтворення завершене</string>
+ <string name="media_err_nothing_to_play">Медіа-файлів не знайдено</string>
+ <string name="media_err_no_account">Обліковий запис не налаштований</string>
+ <string name="media_err_not_in_owncloud">Файл в невірному обліковому записі</string>
+ <string name="media_err_unsupported">Кодек не підтримується</string>
+ <string name="media_err_io">Медіа-файл не читається</string>
+ <string name="media_err_malformed">Медіа-файл невірно закодований</string>
+ <string name="media_err_timeout">Вийшов час на спробу відтворення</string>
+ <string name="media_err_invalid_progressive_playback">Неможливо потоком відтворити файл</string>
+ <string name="media_err_unknown">Медіа-файл неможливо відтворити вбудованим програвачем</string>
+ <string name="media_err_security_ex">Помилка безпеки при відтворені %1$s</string>
+ <string name="media_err_io_ex">Помилка вводу при відтворені %1$s</string>
+ <string name="media_err_unexpected">Несподівана помилка при відтворені %1$s</string>
+ <string name="media_rewind_description">Перемтка назад</string>
+ <string name="media_play_pause_description">Відтворення або пауза</string>
+ <string name="media_forward_description">Перемотка вперед</string>
+ <string name="auth_getting_authorization">Виконується вхід...</string>
<string name="auth_trying_to_login">Спроба входу…</string>
<string name="auth_no_net_conn_title">Відсутнє підключення до мережі</string>
<string name="auth_nossl_plain_ok_title">Безпечне з\'єднання не доступне.</string>
<string name="auth_connection_established">З\'єднання встановлено</string>
<string name="auth_testing_connection">Перевірка з\'єднання…</string>
<string name="auth_not_configured_title">Не вірні налаштування сервер </string>
+ <string name="auth_account_not_new">Такий обліковий запис вже існує на пристрої</string>
+ <string name="auth_account_not_the_same">Введений користувач не відповідає обліковому запису</string>
<string name="auth_unknown_error_title">Виникла невідома помилка!</string>
<string name="auth_unknown_host_title">Не вдалося знайти хост</string>
<string name="auth_incorrect_path_title">Не знайдено примірник сервер</string>
<string name="auth_timeout_title">Сервер занадто довго не відповідає</string>
<string name="auth_incorrect_address_title">Пошкоджений URL</string>
<string name="auth_ssl_general_error_title">Помилка SSL ініціалізації</string>
+ <string name="auth_ssl_unverified_server_title">Неможливо перевірити SSL-сертифікат сервера</string>
<string name="auth_bad_oc_version_title">Не вдалося визначити версію сервер серверу</string>
<string name="auth_wrong_connection_title">Не вдалося встановити з\'єднання</string>
<string name="auth_secure_connection">Встановлено захищене з\'єднання</string>
+ <string name="auth_unauthorized">Невірне ім\'я користувача або пароль</string>
+ <string name="auth_oauth_error">Невдала авторизація</string>
+ <string name="auth_oauth_error_access_denied">Доступ заборонений сервером авторизації</string>
+ <string name="auth_wtf_reenter_URL">Несподівана відповідь; будь ласка, введіть адресу сервера знову</string>
+ <string name="auth_expired_oauth_token_toast">Час авторизації минув. Будь ласка, увійдіть знову</string>
+ <string name="auth_expired_basic_auth_toast">Будь ласка, введіть пароль</string>
+ <string name="auth_expired_saml_sso_token_toast">Час сесії минув. Будь ласка, підключіться знов</string>
+ <string name="auth_connecting_auth_server">Підключення до серверу аутентифікації...</string>
+ <string name="auth_unsupported_auth_method">Сервер не підтримує обраний метод аутентифікації</string>
+ <string name="auth_unsupported_multiaccount">%1$s не підтримує одночасно декілька облікових записів</string>
+ <string name="auth_fail_get_user_name">Ваш сервер не повертає коректний ідентифікатор користувача, будь ласка зверніться до адміністратора
+⇥</string>
+ <string name="auth_can_not_auth_against_server">Аутентифікація на цьому сервері неможлива</string>
<string name="fd_keep_in_sync">Оновлювати файл</string>
<string name="common_rename">Перейменувати</string>
<string name="common_remove">Видалити</string>
+ <string name="confirmation_remove_alert">Ви дійсно бажаєте видалити %1$s?</string>
+ <string name="confirmation_remove_folder_alert">Ви дійсно бажаєте видалити %1$s та весь вміст?</string>
<string name="confirmation_remove_local">Лише локально</string>
<string name="confirmation_remove_folder_local">Лише локальний зміст</string>
<string name="confirmation_remove_remote">Видалити із серверу</string>
<string name="rename_server_fail_msg">Перейменування не вдалося</string>
<string name="sync_file_fail_msg">Неможливо перевірити віддалений файл</string>
<string name="sync_file_nothing_to_do_msg">Зміст файлу вже синхронізовано</string>
+ <string name="create_dir_fail_msg">Не вдалося створити теку</string>
+ <string name="filename_forbidden_characters">Заборонені символи: / \\ < > : \" | ? *</string>
+ <string name="filename_empty"> Ім\'я файлу не може бути порожнім.</string>
<string name="wait_a_moment">Зачекайте хвилинку</string>
<string name="filedisplay_unexpected_bad_get_content">Несподівані проблеми ; будь ласка, спробуйте використати іншу програму для вибору файлу</string>
<string name="filedisplay_no_file_selected">Не обрано файл</string>
+ <string name="activity_chooser_title">Надіслати посилання...</string>
+ <string name="oauth_check_onoff">Увійти через oAuth2</string>
+ <string name="oauth_login_connection">Підключення до серверу oAuth2...</string>
<string name="ssl_validator_header">Не вдалося перевірити ідентифікацію сайта</string>
<string name="ssl_validator_reason_cert_not_trusted">- Не довірений сертифікат серверу</string>
<string name="ssl_validator_reason_cert_expired">- Сертифікат серверу втратив чинність</string>
<string name="ssl_validator_label_validity_to">До:</string>
<string name="ssl_validator_label_signature">Підпис:</string>
<string name="ssl_validator_label_signature_algorithm">Алгоритм:</string>
+ <string name="ssl_validator_null_cert">Не вдалося показати сертифікат.</string>
+ <string name="ssl_validator_no_info_about_error">- Інформація про помилку відсутня</string>
<string name="placeholder_sentence">Це заповнювач</string>
+ <string name="placeholder_filename">placeholder.txt</string>
+ <string name="placeholder_filetype">PNG зображення</string>
+ <string name="placeholder_filesize">389 КБ</string>
+ <string name="placeholder_timestamp">2012/05/18 12:23 PM</string>
+ <string name="placeholder_media_time">12:23:45</string>
<string name="instant_upload_on_wifi">Завантажувати зображення тільки через WiFi</string>
+ <string name="instant_video_upload_on_wifi">Завантажувати відео тільки через WiFi</string>
<string name="instant_upload_path">/InstantUpload</string>
<string name="conflict_title">Конфлікт оновлення</string>
<string name="conflict_message">Віддалений файл %s не синхронізовано з локальним. Продовження процедури замінить вміст файлу на сервері.</string>
<string name="conflict_keep_both">Залишити обидва</string>
<string name="conflict_overwrite">Замінити</string>
<string name="conflict_dont_upload">Не завантажувати</string>
+ <string name="preview_image_description">Попередній перегляд зображення</string>
+ <string name="preview_image_error_unknown_format">Не вдалося показати зображення</string>
+ <string name="error__upload__local_file_not_copied">%1$s неможливо скопіювати до %2$s</string>
+ <string name="prefs_instant_upload_path_title">Завантажити шлях</string>
+ <string name="share_link_no_support_share_api">На жаль, обмін не включений на вашому сервері. Будь ласка, зв\'яжіться з вашим адмінистратором.</string>
+ <string name="share_link_file_no_exist">Неможливо поділитися. Будь ласка, перевірте, чи існує файл</string>
+ <string name="share_link_file_error">Виникла помилка при спробі поділитися файлом або текою</string>
+ <string name="unshare_link_file_no_exist">Неможливо заборонити доступ. Будь ласка, перевірте, чи існує файл</string>
+ <string name="unshare_link_file_error">Виникла помилка при спробі заборонити доступ до файлу або теки</string>
<string name="activity_chooser_send_file_title">Надіслати</string>
+ <string name="copy_link">Копіювати посилання</string>
<string name="clipboard_text_copied">Скопійовано в буфер обміну</string>
+ <string name="error_cant_bind_to_operations_service">Критична помилка: виконання операції неможливе</string>
+ <string name="network_error_socket_exception">Виникла помилка при підключені до сервера.</string>
+ <string name="network_error_socket_timeout_exception">Під час очікування на сервер виникла помилка, операцію неможливо завершити</string>
+ <string name="network_error_connect_timeout_exception">Під час очікування на сервер виникла помилка, операцію неможливо завершити</string>
+ <string name="network_host_not_available">Неможливо завершити операцію, сервер недоступний</string>
<string name="empty"></string>
+ <string name="forbidden_permissions">У вас немає повноважень %s</string>
+ <string name="forbidden_permissions_rename">на перейменування цього файла</string>
+ <string name="forbidden_permissions_delete">на видалення цього файла</string>
+ <string name="share_link_forbidden_permissions">для надання доступу до файла</string>
+ <string name="unshare_link_forbidden_permissions">для закриття доступу до файла</string>
+ <string name="forbidden_permissions_create">для створення файла</string>
+ <string name="uploader_upload_forbidden_permissions">для завантаження в цю теку</string>
+ <string name="downloader_download_file_not_found">Файл більше не доступний на сервері</string>
<string name="prefs_category_accounts">Облікові записи</string>
+ <string name="prefs_add_account">Додати обліковий запис</string>
+ <string name="auth_redirect_non_secure_connection_title">Безпечне підключення перенаправляється через незабезпечений маршрут.</string>
+ <string name="actionbar_logger">Журнали</string>
+ <string name="log_send_history_button">Надіслати історію</string>
+ <string name="log_mail_subject">Журнали Android-додатка ownCloud</string>
+ <string name="log_progress_dialog_text">Завантаження даних...</string>
+ <string name="saml_authentication_required_text">Потрібна аутентифікація</string>
+ <string name="saml_authentication_wrong_pass">Невірний пароль</string>
+ <string name="actionbar_move">Перемістити</string>
+ <string name="file_list_empty_moving">Тут нічого немає. Ви можете додати теку!</string>
<string name="move_choose_button_text">Обрати</string>
+ <string name="move_file_not_found">Неможливо перемістити. Будь ласка, перевірте, чи існує файл</string>
+ <string name="move_file_invalid_into_descendent">Неможливо перемістити теку до теки-нащадка</string>
+ <string name="move_file_invalid_overwrite">Файл вже існує в теці призначення</string>
+ <string name="move_file_error">Виникла помилка при спробі перемістити файл або теку</string>
+ <string name="forbidden_permissions_move">перемістити цей файл</string>
+ <string name="prefs_category_instant_uploading">Миттєво завантаження</string>
+ <string name="prefs_category_security">Безпека</string>
</resources>
<string name="prefs_feedback">反馈</string>
<string name="prefs_imprint">版本说明</string>
<string name="recommend_subject">在您的智能手机上试用一下 %1$s!</string>
+ <string name="recommend_text">“我邀请你使用在你的智能手机上使用 %1$s,在这下载:%2$s”
+ </string>
<string name="auth_check_server">检查服务器</string>
<string name="auth_host_url">服务器地址 https://...</string>
<string name="auth_username">用户名</string>
<string name="sync_fail_in_favourites_content">无法同步 %1$d 文件内容(与 %2$d 冲突)</string>
<string name="sync_foreign_files_forgotten_ticker">某些本地文件已被遗忘</string>
<string name="sync_foreign_files_forgotten_content">%2$s 目录中的 %1$d 个文件不能被复制到</string>
+ <string name="sync_foreign_files_forgotten_explanation">从 1.3.16 版起,从此设备上传的文件将被复制到本地的 %1$s 文件夹,以防止某个单一文件在多个账户间同步而造成的数据损失。\n\n 由于此项变化,此应用之前的版本上传的全部文件都已被复制到了 %2$s 文件夹。然而,账户同步期间有一个错误阻止了此操作的完成。您可能想保持文件不动,并移除指向 %3$s 的链接,或将文件移动到 %1$s 文件夹中并保持其到 %4$s 的链接。下面列出的是本地文件,以及它们被链接到的 %5$s 中的远程文件。</string>
<string name="sync_current_folder_was_removed">文件夹%1$s 不存在</string>
<string name="foreign_files_move">移动所有</string>
<string name="foreign_files_success">所有文件已被移动</string>
<string name="downloader_download_file_not_found">该文件在服务器上不可用</string>
<string name="prefs_category_accounts">账号</string>
<string name="prefs_add_account">添加账号</string>
- <string name="auth_redirect_non_secure_connection_title">安全连接是通过一个非安全路由定向的。</string>
+ <string name="actionbar_logger">日志</string>
+ <string name="log_send_history_button">发送历史</string>
+ <string name="log_mail_subject">ownCloud安卓客户端日志</string>
+ <string name="log_progress_dialog_text">加载数据中...</string>
<string name="saml_authentication_required_text">需要认证</string>
<string name="saml_authentication_wrong_pass">错误密码</string>
<string name="actionbar_move">移动</string>
<string name="file_list_empty_moving">这里还什么都没有。上传些东西吧!</string>
<string name="move_choose_button_text">选择(&C)...</string>
<string name="move_file_not_found">无法移动。请检查文件是否存在</string>
+ <string name="move_file_invalid_into_descendent">b不能够把一个目录移动到它的下级</string>
<string name="move_file_invalid_overwrite">该文件已经存在在目标文件夹</string>
<string name="move_file_error">尝试移动该文件或文件夹时发生错误</string>
<string name="forbidden_permissions_move">移动该文件</string>
+ <string name="prefs_category_security">安全</string>
</resources>
<string name="prefs_feedback">反饋</string>
<string name="prefs_imprint">法律聲明</string>
<string name="recommend_subject">在您的手機中試用%1$s!</string>
+ <string name="recommend_text">我想邀請您在您的手機上使用 %1$s ! 可以由這兒下載: %2$s</string>
<string name="auth_check_server">檢查伺服器</string>
<string name="auth_host_url">伺服器位址 https://...</string>
<string name="auth_username">使用者名稱</string>
<string name="uploader_error_forbidden_content">%1$s 並沒有被允許存取分享的內容</string>
<string name="uploader_info_uploading">上傳中</string>
<string name="file_list_empty">這裡還沒有東西,上傳一些吧!</string>
+ <string name="file_list_loading">載入中…</string>
+ <string name="local_file_list_empty">這個目錄中沒有任何檔案.</string>
<string name="filedetails_select_file">在檔案上輕觸來顯示更多資訊。</string>
<string name="filedetails_size">容量:</string>
<string name="filedetails_type">類型:</string>
<string name="downloader_download_failed_credentials_error">下傳失敗, 您需要重新登入</string>
<string name="common_choose_account">選擇帳號</string>
<string name="sync_fail_ticker">同步失敗</string>
+ <string name="sync_fail_ticker_unauthorized">同步作業失敗, 您需要重新登入</string>
<string name="sync_fail_content">同步 %1$s 未完成</string>
<string name="sync_fail_content_unauthorized">無效的密碼 %1$s</string>
<string name="sync_conflicts_in_favourites_ticker">出現衝突</string>
<string name="sync_fail_in_favourites_content">%1$d 未被同步 (%2$d 衝突)</string>
<string name="sync_foreign_files_forgotten_ticker">有些本地端的檔案已遺失</string>
<string name="sync_foreign_files_forgotten_content">%1$d 檔案超過 %2$s 資料夾可能不能複製進去</string>
+ <string name="sync_foreign_files_forgotten_explanation">在 1.3.16 版之前, 檔案上傳時會先複製到本地的 %1$s 目錄以避免在多帳戶內同步造成遺失.\n\n由於這個改變, 所以在之前版本上傳的檔案被複製到 %2$s 目錄中. 為了避免同步發生問題. 你可以保留那些檔案並刪除連結 %3$s, 或搬移檔案到 %1$s 目錄並取得連結到 %4$s.\n\n下面列表是本地檔案, 與被連結遠端檔案 %5$s.</string>
<string name="sync_current_folder_was_removed">資料夾 %1$s 不存在</string>
<string name="foreign_files_move">移動全部</string>
<string name="foreign_files_success">所有文件已被移動</string>
<string name="foreign_files_fail">部份文件無法被移動</string>
<string name="foreign_files_local_text">本地: %1$s</string>
<string name="foreign_files_remote_text">遠端: %1$s</string>
+ <string name="upload_query_move_foreign_files">無足夠的空間可以複製檔案到 %1$s 目錄. 是否使用移動的方式來處理? </string>
<string name="pincode_enter_pin_code">請輸入您的 App 密碼</string>
<string name="pincode_configure_your_pin">輸入您的 App 密碼</string>
<string name="pincode_configure_your_pin_explanation">這個密碼在你每次啟動這程式時都會被要求輸入</string>
<string name="preview_image_description">圖片預覽</string>
<string name="preview_image_error_unknown_format">無法顯示圖片</string>
<string name="error__upload__local_file_not_copied">%1$s 無法被複製到本地目錄 %2$s</string>
+ <string name="prefs_instant_upload_path_title">上傳目錄</string>
<string name="share_link_no_support_share_api">很抱歉, 您的伺服器並未開啟分享的功能. 請聯絡您的
伺服器管理員.</string>
+ <string name="share_link_file_no_exist">無法分享這個檔案或目錄. 請檢查它們是否存在</string>
<string name="share_link_file_error">在分享檔案或目錄時發生了錯誤</string>
+ <string name="unshare_link_file_no_exist">無法取消分享這個檔案或目錄. 請檢查它們是否存在</string>
<string name="unshare_link_file_error">在取消分享檔案或目錄時發生了錯誤</string>
<string name="activity_chooser_send_file_title">寄出</string>
<string name="copy_link">複製連結</string>
<string name="network_error_connect_timeout_exception">在等待伺服器回應時發生了錯誤, 這個操作將無法被完成</string>
<string name="network_host_not_available">這個操作無法完成, 無法使用伺服器</string>
<string name="empty"></string>
+ <string name="forbidden_permissions">您沒有權限 %s</string>
+ <string name="forbidden_permissions_rename">重新命名檔案</string>
+ <string name="forbidden_permissions_delete">刪除檔案</string>
+ <string name="share_link_forbidden_permissions">分享檔案</string>
+ <string name="unshare_link_forbidden_permissions">取消分享檔案</string>
+ <string name="forbidden_permissions_create">建立檔案</string>
+ <string name="uploader_upload_forbidden_permissions">上傳這個目錄</string>
+ <string name="downloader_download_file_not_found">這個檔案已經不存在於伺服器中</string>
<string name="prefs_category_accounts">帳號</string>
+ <string name="prefs_add_account">新增帳號</string>
+ <string name="auth_redirect_non_secure_connection_title">安全連線被轉向到一個非安全的連線</string>
+ <string name="actionbar_logger">紀錄</string>
+ <string name="log_send_history_button">傳送歷史記錄</string>
+ <string name="log_mail_subject">ownCloud Android 應用程式記錄</string>
+ <string name="log_progress_dialog_text">資料載入中...</string>
<string name="saml_authentication_required_text">必須驗證</string>
<string name="saml_authentication_wrong_pass">密碼錯誤</string>
+ <string name="actionbar_move">移動</string>
+ <string name="file_list_empty_moving">找不到任何檔案. 你可以新增一個目錄!</string>
<string name="move_choose_button_text">選擇</string>
+ <string name="move_file_not_found">無法搬移. 請檢查該檔案是否存在</string>
+ <string name="move_file_invalid_into_descendent">把一個目錄搬移到其底下的子目錄是不可能的</string>
+ <string name="move_file_invalid_overwrite">這個檔案已經存在於目的目錄中</string>
+ <string name="move_file_error">在移動檔案或目錄時發生了錯誤</string>
+ <string name="forbidden_permissions_move">移動這個檔案</string>
+ <string name="prefs_category_instant_uploading">即時上傳</string>
+ <string name="prefs_category_security">安全性</string>
</resources>
<string name="mail_feedback">"mailto:apps@owncloud.com"</string>
<string name="url_app_download">"https://play.google.com/store/apps/details?id=com.owncloud.android"</string>
+ <!--Destination mail for sending log files -->
+ <string name="mail_logger"></string>
+
</resources>
<string name="preview_image_error_unknown_format">This image cannot be shown</string>
<string name="error__upload__local_file_not_copied">%1$s could not be copied to %2$s local folder</string>
+ <string name="prefs_instant_upload_path_title">Upload Path</string>
<string name="share_link_no_support_share_api">Sorry, sharing is not enabled on your server. Please contact your
administrator.</string>
<string name="prefs_category_accounts">Accounts</string>
<string name="prefs_add_account">Add account</string>
- <string name="auth_redirect_non_secure_connection_title">Secure connection is redirected through an unsecured route.</string>
+ <string name="auth_redirect_non_secure_connection_title">Secure connection is redirected to an unsecured route.</string>
+
+ <string name="actionbar_logger">Logs</string>
+ <string name="log_send_history_button">Send History</string>
+ <string name="log_mail_subject">ownCloud Android app logs</string>
+ <string name="log_progress_dialog_text">Loading data...</string>
<string name="saml_authentication_required_text">Authentication required</string>
<string name="saml_authentication_wrong_pass">Wrong password</string>
<string name="move_file_error">An error occurred while trying to move this file or folder</string>
<string name="forbidden_permissions_move">to move this file</string>
+ <string name="prefs_category_instant_uploading">Instant Uploads</string>
+ <string name="prefs_category_security">Security</string>
+
</resources>
<PreferenceCategory android:title="@string/prefs_category_accounts" android:key="accounts_category">
</PreferenceCategory>
- <PreferenceCategory android:title="@string/prefs_category_general">
- <!-- ListPreference
- android:key="select_oc_account"
- android:title="@string/prefs_select_oc_account"
- android:summary="@string/prefs_summary_select_oc_account"
- / -->
- <com.owncloud.android.ui.CheckBoxPreferenceWithLongTitle android:title="@string/prefs_pincode" android:key="set_pincode"
+ <PreferenceCategory android:title="@string/prefs_category_security">
+ <!-- ListPreference
+ android:key="select_oc_account"
+ android:title="@string/prefs_select_oc_account"
+ android:summary="@string/prefs_summary_select_oc_account"
+ / -->
+ <com.owncloud.android.ui.CheckBoxPreferenceWithLongTitle android:title="@string/prefs_pincode" android:key="set_pincode"
android:summary="@string/prefs_pincode_summary"/>
- <com.owncloud.android.ui.CheckBoxPreferenceWithLongTitle android:key="instant_uploading"
- android:title="@string/prefs_instant_upload"
- android:summary="@string/prefs_instant_upload_summary"/>
- <com.owncloud.android.ui.CheckBoxPreferenceWithLongTitle android:dependency="instant_uploading"
- android:disableDependentsState="true"
- android:title="@string/instant_upload_on_wifi"
- android:key="instant_upload_on_wifi"/>
- <com.owncloud.android.ui.CheckBoxPreferenceWithLongTitle android:key="instant_video_uploading"
- android:title="@string/prefs_instant_video_upload"
- android:summary="@string/prefs_instant_video_upload_summary"/>
- <com.owncloud.android.ui.CheckBoxPreferenceWithLongTitle android:dependency="instant_video_uploading"
- android:disableDependentsState="true"
- android:title="@string/instant_video_upload_on_wifi"
- android:key="instant_video_upload_on_wifi"/>
- <!-- DISABLED FOR RELEASE UNTIL FIXED
- CheckBoxPreference android:key="log_to_file"
- android:title="@string/prefs_log_title"
- android:summary="@string/prefs_log_summary"/>
- <Preference android:key="log_history"
- android:title="@string/prefs_log_title_history"
- android:summary="@string/prefs_log_summary_history"/ -->
+ </PreferenceCategory>
+
+ <PreferenceCategory android:title="@string/prefs_category_instant_uploading">
+ <EditTextPreference android:title="@string/prefs_instant_upload_path_title"
+ android:defaultValue="@string/instant_upload_path"
+ android:key="instant_upload_path"/>
+ <com.owncloud.android.ui.CheckBoxPreferenceWithLongTitle android:key="instant_uploading"
+ android:title="@string/prefs_instant_upload"
+ android:summary="@string/prefs_instant_upload_summary"/>
+ <com.owncloud.android.ui.CheckBoxPreferenceWithLongTitle android:dependency="instant_uploading"
+ android:disableDependentsState="true"
+ android:title="@string/instant_upload_on_wifi"
+ android:key="instant_upload_on_wifi"/>
+ <com.owncloud.android.ui.CheckBoxPreferenceWithLongTitle android:key="instant_video_uploading"
+ android:title="@string/prefs_instant_video_upload"
+ android:summary="@string/prefs_instant_video_upload_summary"/>
+ <com.owncloud.android.ui.CheckBoxPreferenceWithLongTitle android:dependency="instant_video_uploading"
+ android:disableDependentsState="true"
+ android:title="@string/instant_video_upload_on_wifi"
+ android:key="instant_video_upload_on_wifi"/>
+ <!-- DISABLED FOR RELEASE UNTIL FIXED
+ CheckBoxPreference android:key="log_to_file"
+ android:title="@string/prefs_log_title"
+ android:summary="@string/prefs_log_summary"/>
+ <Preference android:key="log_history"
+ android:title="@string/prefs_log_title_history"
+ android:summary="@string/prefs_log_summary_history"/ -->
</PreferenceCategory>
</PreferenceCategory>
-</PreferenceScreen>
\ No newline at end of file
+</PreferenceScreen>
-#!/bin/bash
+#!/bin/bash -e
git submodule init
git submodule update
*/
package com.owncloud.android;
-import com.owncloud.android.lib.common.OwnCloudClientManagerFactory;
-import com.owncloud.android.lib.common.OwnCloudClientManagerFactory.Policy;
-
import android.app.Application;
import android.content.Context;
+
+import com.owncloud.android.authentication.AccountUtils;
+import com.owncloud.android.datamodel.ThumbnailsCacheManager;
+import com.owncloud.android.lib.common.OwnCloudClientManagerFactory;
+import com.owncloud.android.lib.common.OwnCloudClientManagerFactory.Policy;
+import com.owncloud.android.lib.common.utils.Log_OC;
/**
* Main Application of the project
*
} else {
OwnCloudClientManagerFactory.setDefaultPolicy(Policy.ALWAYS_NEW_CLIENT);
}
+
+ // initialise thumbnails cache on background thread
+ new ThumbnailsCacheManager.InitDiskCacheTask(AccountUtils.getCurrentOwnCloudAccount(mContext),
+ mContext).execute();
+ if (BuildConfig.DEBUG) {
+
+ String dataFolder = getDataFolder();
+
+ // Set folder for store logs
+ Log_OC.setLogDataFolder(dataFolder);
+
+ Log_OC.startLogging();
+ Log_OC.d("Debug", "start logging");
+ }
}
public static Context getAppContext() {
public static String getAccountType() {
return getAppContext().getResources().getString(R.string.account_type);
}
-
+
// From AccountAuthenticator
// public static final String AUTHORITY = "org.owncloud";
public static String getAuthority() {
import android.widget.Toast;
import com.owncloud.android.lib.common.accounts.AccountTypeUtils;
-import com.owncloud.android.utils.Log_OC;
+import com.owncloud.android.lib.common.utils.Log_OC;
/**
import com.owncloud.android.lib.common.operations.RemoteOperation;\r
import com.owncloud.android.lib.common.operations.RemoteOperationResult;\r
import com.owncloud.android.lib.common.operations.RemoteOperationResult.ResultCode;\r
+import com.owncloud.android.lib.common.utils.Log_OC;\r
import com.owncloud.android.lib.resources.files.ExistenceCheckRemoteOperation;\r
import com.owncloud.android.lib.resources.status.OwnCloudVersion;\r
import com.owncloud.android.lib.resources.users.GetRemoteUserNameOperation;\r
import com.owncloud.android.ui.dialog.SamlWebViewDialog;\r
import com.owncloud.android.ui.dialog.SslUntrustedCertDialog;\r
import com.owncloud.android.ui.dialog.SslUntrustedCertDialog.OnSslUntrustedCertListener;\r
-import com.owncloud.android.utils.Log_OC;\r
\r
/**\r
* This Activity is used to add an ownCloud account to the App\r
if (mAccount != null) {\r
boolean oAuthRequired = \r
(mAccountMgr.getUserData(mAccount, Constants.KEY_SUPPORTS_OAUTH2) != null);\r
- boolean samlWebSsoRequired = \r
- (mAccountMgr.getUserData(mAccount, Constants.KEY_SUPPORTS_SAML_WEB_SSO) != null);\r
+ boolean samlWebSsoRequired = ( \r
+ mAccountMgr.getUserData(\r
+ mAccount, Constants.KEY_SUPPORTS_SAML_WEB_SSO\r
+ ) != null\r
+ );\r
mAuthTokenType = chooseAuthTokenType(oAuthRequired, samlWebSsoRequired);\r
\r
} else {\r
boolean oAuthSupported = AUTH_ON.equals(getString(R.string.auth_method_oauth2));\r
- boolean samlWebSsoSupported = AUTH_ON.equals(getString(R.string.auth_method_saml_web_sso));\r
+ boolean samlWebSsoSupported = \r
+ AUTH_ON.equals(getString(R.string.auth_method_saml_web_sso));\r
mAuthTokenType = chooseAuthTokenType(oAuthSupported, samlWebSsoSupported);\r
}\r
}\r
if (savedInstanceState == null) {\r
if (mAccount != null) {\r
mServerInfo.mBaseUrl = mAccountMgr.getUserData(mAccount, Constants.KEY_OC_BASE_URL);\r
- mServerInfo.mIsSslConn = mServerInfo.mBaseUrl.startsWith("https://"); // TODO do this in a setter for mBaseUrl\r
+ // TODO do next in a setter for mBaseUrl\r
+ mServerInfo.mIsSslConn = mServerInfo.mBaseUrl.startsWith("https://"); \r
String ocVersion = mAccountMgr.getUserData(mAccount, Constants.KEY_OC_VERSION);\r
if (ocVersion != null) {\r
mServerInfo.mVersion = new OwnCloudVersion(ocVersion);\r
@Override\r
public boolean onTouch(View view, MotionEvent event) {\r
if (event.getAction() == MotionEvent.ACTION_DOWN) {\r
- if (AccountTypeUtils.getAuthTokenTypeSamlSessionCookie(MainApp.getAccountType()).equals(mAuthTokenType) &&\r
- mHostUrlInput.hasFocus()) {\r
+ if (\r
+ AccountTypeUtils.getAuthTokenTypeSamlSessionCookie(\r
+ MainApp.getAccountType()\r
+ ).equals(mAuthTokenType) &&\r
+ mHostUrlInput.hasFocus()\r
+ ) {\r
checkOcServer();\r
}\r
}\r
/**\r
* Saves relevant state before {@link #onPause()}\r
* \r
- * Do NOT save {@link #mNewCapturedUriFromOAuth2Redirection}; it keeps a temporal flag, intended to defer the \r
- * processing of the redirection caught in {@link #onNewIntent(Intent)} until {@link #onResume()} \r
+ * Do NOT save {@link #mNewCapturedUriFromOAuth2Redirection}; it keeps a temporal flag, \r
+ * intended to defer the processing of the redirection caught in \r
+ * {@link #onNewIntent(Intent)} until {@link #onResume()} \r
* \r
* See {@link #loadSavedInstanceState(Bundle)}\r
*/\r
\r
\r
/**\r
- * The redirection triggered by the OAuth authentication server as response to the GET AUTHORIZATION request\r
- * is caught here.\r
+ * The redirection triggered by the OAuth authentication server as response to the \r
+ * GET AUTHORIZATION request is caught here.\r
* \r
- * To make this possible, this activity needs to be qualified with android:launchMode = "singleTask" in the\r
- * AndroidManifest.xml file.\r
+ * To make this possible, this activity needs to be qualified with android:launchMode = \r
+ * "singleTask" in the AndroidManifest.xml file.\r
*/\r
@Override\r
protected void onNewIntent (Intent intent) {\r
\r
\r
/**\r
- * The redirection triggered by the OAuth authentication server as response to the GET AUTHORIZATION, and \r
- * deferred in {@link #onNewIntent(Intent)}, is processed here.\r
+ * The redirection triggered by the OAuth authentication server as response to the \r
+ * GET AUTHORIZATION, and deferred in {@link #onNewIntent(Intent)}, is processed here.\r
*/\r
@Override\r
protected void onResume() {\r
\r
Intent getServerInfoIntent = new Intent();\r
getServerInfoIntent.setAction(OperationsService.ACTION_GET_SERVER_INFO);\r
- getServerInfoIntent.putExtra(OperationsService.EXTRA_SERVER_URL, uri);\r
+ getServerInfoIntent.putExtra(\r
+ OperationsService.EXTRA_SERVER_URL, \r
+ normalizeUrlSuffix(uri)\r
+ );\r
if (mOperationsServiceBinder != null) {\r
mWaitingForOpId = mOperationsServiceBinder.newOperation(getServerInfoIntent);\r
} else {\r
}\r
\r
private boolean isPasswordVisible() {\r
- return ((mPasswordInput.getInputType() & InputType.TYPE_TEXT_VARIATION_VISIBLE_PASSWORD) == InputType.TYPE_TEXT_VARIATION_VISIBLE_PASSWORD);\r
+ return ((mPasswordInput.getInputType() & InputType.TYPE_TEXT_VARIATION_VISIBLE_PASSWORD) == \r
+ InputType.TYPE_TEXT_VARIATION_VISIBLE_PASSWORD);\r
}\r
\r
private void hidePasswordButton() {\r
}\r
\r
private void showPassword() {\r
- mPasswordInput.setInputType(InputType.TYPE_CLASS_TEXT | InputType.TYPE_TEXT_VARIATION_VISIBLE_PASSWORD);\r
+ mPasswordInput.setInputType(\r
+ InputType.TYPE_CLASS_TEXT | InputType.TYPE_TEXT_VARIATION_VISIBLE_PASSWORD\r
+ );\r
showViewPasswordButton();\r
}\r
\r
private void hidePassword() {\r
- mPasswordInput.setInputType(InputType.TYPE_CLASS_TEXT | InputType.TYPE_TEXT_VARIATION_PASSWORD);\r
+ mPasswordInput.setInputType(\r
+ InputType.TYPE_CLASS_TEXT | InputType.TYPE_TEXT_VARIATION_PASSWORD\r
+ );\r
showViewPasswordButton();\r
}\r
\r
return;\r
}\r
\r
- if (AccountTypeUtils.getAuthTokenTypeAccessToken(MainApp.getAccountType()).equals(mAuthTokenType)) {\r
+ if (AccountTypeUtils.getAuthTokenTypeAccessToken(MainApp.getAccountType()).\r
+ equals(mAuthTokenType)) {\r
+ \r
startOauthorization();\r
- } else if (AccountTypeUtils.getAuthTokenTypeSamlSessionCookie(MainApp.getAccountType()).equals(mAuthTokenType)) { \r
+ } else if (AccountTypeUtils.getAuthTokenTypeSamlSessionCookie(MainApp.getAccountType()).\r
+ equals(mAuthTokenType)) {\r
+ \r
startSamlBasedFederatedSingleSignOnAuthorization();\r
} else {\r
checkBasicAuthorization();\r
// GET AUTHORIZATION request\r
Uri uri = Uri.parse(mOAuthAuthEndpointText.getText().toString().trim());\r
Uri.Builder uriBuilder = uri.buildUpon();\r
- uriBuilder.appendQueryParameter(OAuth2Constants.KEY_RESPONSE_TYPE, getString(R.string.oauth2_response_type));\r
- uriBuilder.appendQueryParameter(OAuth2Constants.KEY_REDIRECT_URI, getString(R.string.oauth2_redirect_uri)); \r
- uriBuilder.appendQueryParameter(OAuth2Constants.KEY_CLIENT_ID, getString(R.string.oauth2_client_id));\r
- uriBuilder.appendQueryParameter(OAuth2Constants.KEY_SCOPE, getString(R.string.oauth2_scope));\r
+ uriBuilder.appendQueryParameter(\r
+ OAuth2Constants.KEY_RESPONSE_TYPE, getString(R.string.oauth2_response_type)\r
+ );\r
+ uriBuilder.appendQueryParameter(\r
+ OAuth2Constants.KEY_REDIRECT_URI, getString(R.string.oauth2_redirect_uri)\r
+ ); \r
+ uriBuilder.appendQueryParameter(\r
+ OAuth2Constants.KEY_CLIENT_ID, getString(R.string.oauth2_client_id)\r
+ );\r
+ uriBuilder.appendQueryParameter(\r
+ OAuth2Constants.KEY_SCOPE, getString(R.string.oauth2_scope)\r
+ );\r
uri = uriBuilder.build();\r
Log_OC.d(TAG, "Starting browser to view " + uri.toString());\r
Intent i = new Intent(Intent.ACTION_VIEW, uri);\r
\r
} else if (operation instanceof ExistenceCheckRemoteOperation) {\r
//Log_OC.wtf(TAG, "received detection response through callback" );\r
- if (AccountTypeUtils.getAuthTokenTypeSamlSessionCookie(MainApp.getAccountType()).equals(mAuthTokenType)) {\r
+ if (AccountTypeUtils.getAuthTokenTypeSamlSessionCookie(MainApp.getAccountType()).\r
+ equals(mAuthTokenType)) {\r
onSamlBasedFederatedSingleSignOnAuthorizationStart(result);\r
\r
} else {\r
url = "http://" + url;\r
}\r
}\r
- \r
- url = trimUrlWebdav(url);\r
-\r
- if (url.endsWith("/")) {\r
- url = url.substring(0, url.length() - 1);\r
- }\r
-\r
+ \r
+ url = normalizeUrlSuffix(url);\r
}\r
return (url != null ? url : "");\r
}\r
+ \r
+ \r
+ private String normalizeUrlSuffix(String url) {\r
+ if (url.endsWith("/")) {\r
+ url = url.substring(0, url.length() - 1);\r
+ }\r
+ url = trimUrlWebdav(url);\r
+ return url;\r
+ }\r
\r
\r
// TODO remove, if possible\r
@SuppressWarnings("unchecked")\r
Map<String, String> tokens = (Map<String, String>)(result.getData().get(0));\r
mAuthToken = tokens.get(OAuth2Constants.KEY_ACCESS_TOKEN);\r
- //mAuthToken = ((OAuth2GetAccessToken)operation).getResultTokenMap().get(OAuth2Constants.KEY_ACCESS_TOKEN);\r
Log_OC.d(TAG, "Got ACCESS TOKEN: " + mAuthToken);\r
\r
accessRootFolderRemoteOperation("", "");\r
showRefreshButton(true);\r
mOkButton.setEnabled(false);\r
\r
- // very special case (TODO: move to a common place for all the remote operations) (dangerous here?)\r
+ // very special case (TODO: move to a common place for all the remote operations)\r
if (result.getCode() == ResultCode.SSL_RECOVERABLE_PEER_UNVERIFIED) {\r
showUntrustedCertDialog(result);\r
}\r
\r
\r
/**\r
- * Sets the proper response to get that the Account Authenticator that started this activity saves \r
- * a new authorization token for mAccount.\r
+ * Sets the proper response to get that the Account Authenticator that started this activity \r
+ * saves a new authorization token for mAccount.\r
*/\r
private void updateToken() {\r
Bundle response = new Bundle();\r
response.putString(AccountManager.KEY_ACCOUNT_NAME, mAccount.name);\r
response.putString(AccountManager.KEY_ACCOUNT_TYPE, mAccount.type);\r
\r
- if (AccountTypeUtils.getAuthTokenTypeAccessToken(MainApp.getAccountType()).equals(mAuthTokenType)) { \r
+ if (AccountTypeUtils.getAuthTokenTypeAccessToken(MainApp.getAccountType()).\r
+ equals(mAuthTokenType)) { \r
response.putString(AccountManager.KEY_AUTHTOKEN, mAuthToken);\r
- // the next line is necessary; by now, notifications are calling directly to the AuthenticatorActivity to update, without AccountManager intervention\r
+ // the next line is necessary, notifications are calling directly to the \r
+ // AuthenticatorActivity to update, without AccountManager intervention\r
mAccountMgr.setAuthToken(mAccount, mAuthTokenType, mAuthToken);\r
\r
- } else if (AccountTypeUtils.getAuthTokenTypeSamlSessionCookie(MainApp.getAccountType()).equals(mAuthTokenType)) {\r
+ } else if (AccountTypeUtils.getAuthTokenTypeSamlSessionCookie(MainApp.getAccountType()).\r
+ equals(mAuthTokenType)) {\r
\r
response.putString(AccountManager.KEY_AUTHTOKEN, mAuthToken);\r
- // the next line is necessary; by now, notifications are calling directly to the AuthenticatorActivity to update, without AccountManager intervention\r
+ // the next line is necessary; by now, notifications are calling directly to the \r
+ // AuthenticatorActivity to update, without AccountManager intervention\r
mAccountMgr.setAuthToken(mAccount, mAuthTokenType, mAuthToken);\r
\r
} else {\r
*/\r
private boolean createAccount() {\r
/// create and save new ownCloud account\r
- boolean isOAuth = AccountTypeUtils.getAuthTokenTypeAccessToken(MainApp.getAccountType()).equals(mAuthTokenType);\r
- boolean isSaml = AccountTypeUtils.getAuthTokenTypeSamlSessionCookie(MainApp.getAccountType()).equals(mAuthTokenType);\r
+ boolean isOAuth = AccountTypeUtils.\r
+ getAuthTokenTypeAccessToken(MainApp.getAccountType()).equals(mAuthTokenType);\r
+ boolean isSaml = AccountTypeUtils.\r
+ getAuthTokenTypeSamlSessionCookie(MainApp.getAccountType()).equals(mAuthTokenType);\r
\r
Uri uri = Uri.parse(mServerInfo.mBaseUrl);\r
String username = mUsernameInput.getText().toString().trim();\r
mAccount = newAccount;\r
\r
if (isOAuth || isSaml) {\r
- mAccountMgr.addAccountExplicitly(mAccount, "", null); // with external authorizations, the password is never input in the app\r
+ // with external authorizations, the password is never input in the app\r
+ mAccountMgr.addAccountExplicitly(mAccount, "", null); \r
} else {\r
- mAccountMgr.addAccountExplicitly(mAccount, mPasswordInput.getText().toString(), null);\r
+ mAccountMgr.addAccountExplicitly(\r
+ mAccount, mPasswordInput.getText().toString(), null\r
+ );\r
}\r
\r
/// add the new account as default in preferences, if there is none already\r
}\r
\r
/// prepare result to return to the Authenticator\r
- // TODO check again what the Authenticator makes with it; probably has the same effect as addAccountExplicitly, but it's not well done\r
+ // TODO check again what the Authenticator makes with it; probably has the same \r
+ // effect as addAccountExplicitly, but it's not well done\r
final Intent intent = new Intent(); \r
intent.putExtra(AccountManager.KEY_ACCOUNT_TYPE, MainApp.getAccountType());\r
intent.putExtra(AccountManager.KEY_ACCOUNT_NAME, mAccount.name);\r
if (isOAuth || isSaml) {\r
mAccountMgr.setAuthToken(mAccount, mAuthTokenType, mAuthToken);\r
}\r
- /// add user data to the new account; TODO probably can be done in the last parameter addAccountExplicitly, or in KEY_USERDATA
- mAccountMgr.setUserData(mAccount, Constants.KEY_OC_VERSION, mServerInfo.mVersion.getVersion());\r
- mAccountMgr.setUserData(mAccount, Constants.KEY_OC_BASE_URL, mServerInfo.mBaseUrl);\r
+ /// add user data to the new account; TODO probably can be done in the last parameter \r
+ // addAccountExplicitly, or in KEY_USERDATA
+ mAccountMgr.setUserData(\r
+ mAccount, Constants.KEY_OC_VERSION, mServerInfo.mVersion.getVersion()\r
+ );\r
+ mAccountMgr.setUserData(\r
+ mAccount, Constants.KEY_OC_BASE_URL, mServerInfo.mBaseUrl\r
+ );\r
if (isSaml) {\r
mAccountMgr.setUserData(mAccount, Constants.KEY_SUPPORTS_SAML_WEB_SSO, "TRUE"); \r
* @param view 'Account register' button\r
*/\r
public void onRegisterClick(View view) {\r
- Intent register = new Intent(Intent.ACTION_VIEW, Uri.parse(getString(R.string.welcome_link_url)));\r
+ Intent register = new Intent(\r
+ Intent.ACTION_VIEW, Uri.parse(getString(R.string.welcome_link_url))\r
+ );\r
setResult(RESULT_CANCELED);\r
startActivity(register);\r
}\r
/**\r
* Called when the 'action' button in an IME is pressed ('enter' in software keyboard).\r
* \r
- * Used to trigger the authentication check when the user presses 'enter' after writing the password, \r
- * or to throw the server test when the only field on screen is the URL input field.\r
+ * Used to trigger the authentication check when the user presses 'enter' after writing the \r
+ * password, or to throw the server test when the only field on screen is the URL input field.\r
*/\r
@Override\r
public boolean onEditorAction(TextView inputField, int actionId, KeyEvent event) {\r
- if (actionId == EditorInfo.IME_ACTION_DONE && inputField != null && inputField.equals(mPasswordInput)) {\r
+ if (actionId == EditorInfo.IME_ACTION_DONE && inputField != null && \r
+ inputField.equals(mPasswordInput)) {\r
if (mOkButton.isEnabled()) {\r
mOkButton.performClick();\r
}\r
\r
- } else if (actionId == EditorInfo.IME_ACTION_NEXT && inputField != null && inputField.equals(mHostUrlInput)) {\r
- if (AccountTypeUtils.getAuthTokenTypeSamlSessionCookie(MainApp.getAccountType()).equals(mAuthTokenType)) {\r
+ } else if (actionId == EditorInfo.IME_ACTION_NEXT && inputField != null && \r
+ inputField.equals(mHostUrlInput)) {\r
+ if (AccountTypeUtils.getAuthTokenTypeSamlSessionCookie(MainApp.getAccountType()).\r
+ equals(mAuthTokenType)) {\r
checkOcServer();\r
}\r
}\r
final int x = (int) event.getX();\r
final int y = (int) event.getY();\r
final Rect bounds = rightDrawable.getBounds();\r
- if (x >= (view.getRight() - bounds.width() - fuzz) && x <= (view.getRight() - view.getPaddingRight() + fuzz)\r
- && y >= (view.getPaddingTop() - fuzz) && y <= (view.getHeight() - view.getPaddingBottom()) + fuzz) {\r
+ if ( x >= (view.getRight() - bounds.width() - fuzz) && \r
+ x <= (view.getRight() - view.getPaddingRight() + fuzz) && \r
+ y >= (view.getPaddingTop() - fuzz) &&\r
+ y <= (view.getHeight() - view.getPaddingBottom()) + fuzz) {\r
\r
return onDrawableTouch(event);\r
}\r
\r
@Override\r
public boolean onTouchEvent(MotionEvent event) {\r
- if (AccountTypeUtils.getAuthTokenTypeSamlSessionCookie(MainApp.getAccountType()).equals(mAuthTokenType) &&\r
+ if (AccountTypeUtils.getAuthTokenTypeSamlSessionCookie(MainApp.getAccountType()).\r
+ equals(mAuthTokenType) &&\r
mHostUrlInput.hasFocus() && event.getAction() == MotionEvent.ACTION_DOWN) {\r
checkOcServer();\r
}\r
/**\r
* Show untrusted cert dialog \r
*/\r
- public void showUntrustedCertDialog(X509Certificate x509Certificate, SslError error, SslErrorHandler handler) {\r
+ public void showUntrustedCertDialog(\r
+ X509Certificate x509Certificate, SslError error, SslErrorHandler handler\r
+ ) {\r
// Show a dialog with the certificate info\r
SslUntrustedCertDialog dialog = null;\r
if (x509Certificate == null) {\r
dialog = SslUntrustedCertDialog.newInstanceForEmptySslError(error, handler);\r
} else {\r
- dialog = SslUntrustedCertDialog.newInstanceForFullSslError(x509Certificate, error, handler);\r
+ dialog = SslUntrustedCertDialog.\r
+ newInstanceForFullSslError(x509Certificate, error, handler);\r
}\r
FragmentManager fm = getSupportFragmentManager();\r
FragmentTransaction ft = fm.beginTransaction();\r
*/\r
private void showUntrustedCertDialog(RemoteOperationResult result) {\r
// Show a dialog with the certificate info\r
- SslUntrustedCertDialog dialog = SslUntrustedCertDialog.newInstanceForFullSslError((CertificateCombinedException)result.getException());\r
+ SslUntrustedCertDialog dialog = SslUntrustedCertDialog.\r
+ newInstanceForFullSslError((CertificateCombinedException)result.getException());\r
FragmentManager fm = getSupportFragmentManager();\r
FragmentTransaction ft = fm.beginTransaction();\r
ft.addToBackStack(null);\r
public void onSavedCertificate() {\r
Fragment fd = getSupportFragmentManager().findFragmentByTag(SAML_DIALOG_TAG);\r
if (fd == null) {\r
- // if SAML dialog is not shown, the SslDialog was shown due to an SSL error in the server check\r
+ // if SAML dialog is not shown, \r
+ // the SslDialog was shown due to an SSL error in the server check\r
checkOcServer();\r
}\r
}\r
\r
@Override\r
public void onServiceConnected(ComponentName component, IBinder service) {\r
- if (component.equals(new ComponentName(AuthenticatorActivity.this, OperationsService.class))) {\r
+ if (component.equals(\r
+ new ComponentName(AuthenticatorActivity.this, OperationsService.class)\r
+ )) {\r
//Log_OC.wtf(TAG, "Operations service connected");\r
mOperationsServiceBinder = (OperationsServiceBinder) service;\r
\r
\r
@Override\r
public void onServiceDisconnected(ComponentName component) {\r
- if (component.equals(new ComponentName(AuthenticatorActivity.this, OperationsService.class))) {\r
+ if (component.equals(\r
+ new ComponentName(AuthenticatorActivity.this, OperationsService.class)\r
+ )) {\r
Log_OC.e(TAG, "Operations service crashed");\r
mOperationsServiceBinder = null;\r
}\r
public void createAuthenticationDialog(WebView webView, HttpAuthHandler handler) {\r
\r
// Show a dialog with the certificate info\r
- CredentialsDialogFragment dialog = CredentialsDialogFragment.newInstanceForCredentials(webView, handler);\r
+ CredentialsDialogFragment dialog = \r
+ CredentialsDialogFragment.newInstanceForCredentials(webView, handler);\r
FragmentManager fm = getSupportFragmentManager();\r
FragmentTransaction ft = fm.beginTransaction();\r
ft.addToBackStack(null);\r
dialog.show(ft, CREDENTIALS_DIALOG_TAG);\r
\r
if (!mIsFirstAuthAttempt) {\r
- Toast.makeText(getApplicationContext(), getText(R.string.saml_authentication_wrong_pass), Toast.LENGTH_LONG).show();\r
+ Toast.makeText(\r
+ getApplicationContext(), \r
+ getText(R.string.saml_authentication_wrong_pass), \r
+ Toast.LENGTH_LONG\r
+ ).show();\r
} else {\r
mIsFirstAuthAttempt = false;\r
}\r
import java.security.cert.CertificateFactory;
import java.security.cert.X509Certificate;
+import com.owncloud.android.lib.common.network.NetworkUtils;
+import com.owncloud.android.lib.common.utils.Log_OC;
+
import android.content.Context;
import android.graphics.Bitmap;
import android.net.http.SslCertificate;
import android.webkit.WebView;
import android.webkit.WebViewClient;
-import com.owncloud.android.lib.common.network.NetworkUtils;
-import com.owncloud.android.utils.Log_OC;
-
/**
* Custom {@link WebViewClient} client aimed to catch the end of a single-sign-on process
import com.owncloud.android.MainApp;
import com.owncloud.android.db.ProviderMeta.ProviderTableMeta;
+import com.owncloud.android.lib.common.utils.Log_OC;
import com.owncloud.android.lib.resources.shares.OCShare;
import com.owncloud.android.lib.resources.shares.ShareType;
import com.owncloud.android.lib.resources.files.FileUtils;
import com.owncloud.android.utils.FileStorageUtils;
-import com.owncloud.android.utils.Log_OC;
import android.accounts.Account;
public Vector<OCFile> getFolderImages(OCFile folder) {
Vector<OCFile> ret = new Vector<OCFile>();
if (folder != null) {
- // TODO better implementation, filtering in the access to database (if possible) instead of here
+ // TODO better implementation, filtering in the access to database instead of here
Vector<OCFile> tmp = getFolderContent(folder);
OCFile current = null;
for (int i=0; i<tmp.size(); i++) {
boolean overriden = false;
ContentValues cv = new ContentValues();
cv.put(ProviderTableMeta.FILE_MODIFIED, file.getModificationTimestamp());
- cv.put(ProviderTableMeta.FILE_MODIFIED_AT_LAST_SYNC_FOR_DATA, file.getModificationTimestampAtLastSyncForData());
+ cv.put(
+ ProviderTableMeta.FILE_MODIFIED_AT_LAST_SYNC_FOR_DATA,
+ file.getModificationTimestampAtLastSyncForData()
+ );
cv.put(ProviderTableMeta.FILE_CREATION, file.getCreationTimestamp());
cv.put(ProviderTableMeta.FILE_CONTENT_LENGTH, file.getFileLength());
cv.put(ProviderTableMeta.FILE_CONTENT_TYPE, file.getMimetype());
cv.put(ProviderTableMeta.FILE_PUBLIC_LINK, file.getPublicLink());
cv.put(ProviderTableMeta.FILE_PERMISSIONS, file.getPermissions());
cv.put(ProviderTableMeta.FILE_REMOTE_ID, file.getRemoteId());
+ cv.put(ProviderTableMeta.FILE_UPDATE_THUMBNAIL, file.needsUpdateThumbnail());
boolean sameRemotePath = fileExists(file.getRemotePath());
if (sameRemotePath ||
- fileExists(file.getFileId()) ) { // for renamed files; no more delete and create
+ fileExists(file.getFileId()) ) { // for renamed files
OCFile oldFile = null;
if (sameRemotePath) {
* @param files
* @param removeNotUpdated
*/
- public void saveFolder(OCFile folder, Collection<OCFile> updatedFiles, Collection<OCFile> filesToRemove) {
+ public void saveFolder(
+ OCFile folder, Collection<OCFile> updatedFiles, Collection<OCFile> filesToRemove
+ ) {
- Log_OC.d(TAG, "Saving folder " + folder.getRemotePath() + " with " + updatedFiles.size() + " children and " + filesToRemove.size() + " files to remove");
+ Log_OC.d(TAG, "Saving folder " + folder.getRemotePath() + " with " + updatedFiles.size()
+ + " children and " + filesToRemove.size() + " files to remove");
- ArrayList<ContentProviderOperation> operations = new ArrayList<ContentProviderOperation>(updatedFiles.size());
+ ArrayList<ContentProviderOperation> operations =
+ new ArrayList<ContentProviderOperation>(updatedFiles.size());
// prepare operations to insert or update files to save in the given folder
for (OCFile file : updatedFiles) {
ContentValues cv = new ContentValues();
cv.put(ProviderTableMeta.FILE_MODIFIED, file.getModificationTimestamp());
- cv.put(ProviderTableMeta.FILE_MODIFIED_AT_LAST_SYNC_FOR_DATA, file.getModificationTimestampAtLastSyncForData());
+ cv.put(
+ ProviderTableMeta.FILE_MODIFIED_AT_LAST_SYNC_FOR_DATA,
+ file.getModificationTimestampAtLastSyncForData()
+ );
cv.put(ProviderTableMeta.FILE_CREATION, file.getCreationTimestamp());
cv.put(ProviderTableMeta.FILE_CONTENT_LENGTH, file.getFileLength());
cv.put(ProviderTableMeta.FILE_CONTENT_TYPE, file.getMimetype());
} else {
// adding a new file
- operations.add(ContentProviderOperation.newInsert(ProviderTableMeta.CONTENT_URI).withValues(cv).build());
+ operations.add(ContentProviderOperation.newInsert(ProviderTableMeta.CONTENT_URI).
+ withValues(cv).build());
}
}
// prepare operations to remove files in the given folder
- String where = ProviderTableMeta.FILE_ACCOUNT_OWNER + "=?" + " AND " + ProviderTableMeta.FILE_PATH + "=?";
+ String where = ProviderTableMeta.FILE_ACCOUNT_OWNER + "=?" + " AND " +
+ ProviderTableMeta.FILE_PATH + "=?";
String [] whereArgs = null;
for (OCFile file : filesToRemove) {
if (file.getParentId() == folder.getFileId()) {
whereArgs = new String[]{mAccount.name, file.getRemotePath()};
//Uri.withAppendedPath(ProviderTableMeta.CONTENT_URI_FILE, "" + file.getFileId());
if (file.isFolder()) {
- operations.add(ContentProviderOperation
- .newDelete(ContentUris.withAppendedId(ProviderTableMeta.CONTENT_URI_DIR, file.getFileId())).withSelection(where, whereArgs)
- .build());
- // TODO remove local folder
+ operations.add(ContentProviderOperation.newDelete(
+ ContentUris.withAppendedId(
+ ProviderTableMeta.CONTENT_URI_DIR, file.getFileId()
+ )
+ ).withSelection(where, whereArgs).build());
+
+ File localFolder =
+ new File(FileStorageUtils.getDefaultSavePathFor(mAccount.name, file));
+ if (localFolder.exists()) {
+ removeLocalFolder(localFolder);
+ }
} else {
- operations.add(ContentProviderOperation
- .newDelete(ContentUris.withAppendedId(ProviderTableMeta.CONTENT_URI_FILE, file.getFileId())).withSelection(where, whereArgs)
- .build());
+ operations.add(ContentProviderOperation.newDelete(
+ ContentUris.withAppendedId(
+ ProviderTableMeta.CONTENT_URI_FILE, file.getFileId()
+ )
+ ).withSelection(where, whereArgs).build());
+
if (file.isDown()) {
new File(file.getStoragePath()).delete();
- // TODO move the deletion of local contents after success of deletions
}
}
}
// update metadata of folder
ContentValues cv = new ContentValues();
cv.put(ProviderTableMeta.FILE_MODIFIED, folder.getModificationTimestamp());
- cv.put(ProviderTableMeta.FILE_MODIFIED_AT_LAST_SYNC_FOR_DATA, folder.getModificationTimestampAtLastSyncForData());
+ cv.put(
+ ProviderTableMeta.FILE_MODIFIED_AT_LAST_SYNC_FOR_DATA,
+ folder.getModificationTimestampAtLastSyncForData()
+ );
cv.put(ProviderTableMeta.FILE_CREATION, folder.getCreationTimestamp());
- cv.put(ProviderTableMeta.FILE_CONTENT_LENGTH, 0); // FileContentProvider calculates the right size
+ cv.put(ProviderTableMeta.FILE_CONTENT_LENGTH, 0);
cv.put(ProviderTableMeta.FILE_CONTENT_TYPE, folder.getMimetype());
cv.put(ProviderTableMeta.FILE_NAME, folder.getFileName());
cv.put(ProviderTableMeta.FILE_PARENT, folder.getParentId());
// Log_OC.d(TAG, "Updating size of " + id);
// if (getContentResolver() != null) {
// getContentResolver().update(ProviderTableMeta.CONTENT_URI_DIR,
-// new ContentValues(), // won't be used, but cannot be null; crashes in KLP
+// new ContentValues(),
+ // won't be used, but cannot be null; crashes in KLP
// ProviderTableMeta._ID + "=?",
// new String[] { String.valueOf(id) });
// } else {
// try {
// getContentProviderClient().update(ProviderTableMeta.CONTENT_URI_DIR,
-// new ContentValues(), // won't be used, but cannot be null; crashes in KLP
+// new ContentValues(),
+ // won't be used, but cannot be null; crashes in KLP
// ProviderTableMeta._ID + "=?",
// new String[] { String.valueOf(id) });
//
// } catch (RemoteException e) {
-// Log_OC.e(TAG, "Exception in update of folder size through compatibility patch " + e.getMessage());
+// Log_OC.e(
+// TAG, "Exception in update of folder size through compatibility patch " + e.getMessage());
// }
// }
// } else {
} else {
if (removeDBData) {
- //Uri file_uri = Uri.withAppendedPath(ProviderTableMeta.CONTENT_URI_FILE, ""+file.getFileId());
- Uri file_uri = ContentUris.withAppendedId(ProviderTableMeta.CONTENT_URI_FILE, file.getFileId());
- String where = ProviderTableMeta.FILE_ACCOUNT_OWNER + "=?" + " AND " + ProviderTableMeta.FILE_PATH + "=?";
+ Uri file_uri = ContentUris.withAppendedId(
+ ProviderTableMeta.CONTENT_URI_FILE,
+ file.getFileId()
+ );
+ String where = ProviderTableMeta.FILE_ACCOUNT_OWNER + "=?" + " AND " +
+ ProviderTableMeta.FILE_PATH + "=?";
String [] whereArgs = new String[]{mAccount.name, file.getRemotePath()};
int deleted = 0;
if (getContentProviderClient() != null) {
}
private boolean removeFolderInDb(OCFile folder) {
- Uri folder_uri = Uri.withAppendedPath(ProviderTableMeta.CONTENT_URI_DIR, ""+ folder.getFileId()); // URI for recursive deletion
- String where = ProviderTableMeta.FILE_ACCOUNT_OWNER + "=?" + " AND " + ProviderTableMeta.FILE_PATH + "=?";
+ Uri folder_uri = Uri.withAppendedPath(ProviderTableMeta.CONTENT_URI_DIR, "" +
+ folder.getFileId()); // URI for recursive deletion
+ String where = ProviderTableMeta.FILE_ACCOUNT_OWNER + "=?" + " AND " +
+ ProviderTableMeta.FILE_PATH + "=?";
String [] whereArgs = new String[]{mAccount.name, folder.getRemotePath()};
int deleted = 0;
if (getContentProviderClient() != null) {
public void moveFolder(OCFile folder, String newPath) {
// TODO check newPath
- if (folder != null && folder.isFolder() && folder.fileExists() && !OCFile.ROOT_PATH.equals(folder.getFileName())) {
+ if ( folder != null && folder.isFolder() &&
+ folder.fileExists() && !OCFile.ROOT_PATH.equals(folder.getFileName())
+ ) {
/// 1. get all the descendants of 'dir' in a single QUERY (including 'dir')
Cursor c = null;
if (getContentProviderClient() != null) {
try {
- c = getContentProviderClient().query(ProviderTableMeta.CONTENT_URI,
- null,
- ProviderTableMeta.FILE_ACCOUNT_OWNER + "=? AND " + ProviderTableMeta.FILE_PATH + " LIKE ? ",
- new String[] { mAccount.name, folder.getRemotePath() + "%" }, ProviderTableMeta.FILE_PATH + " ASC ");
+ c = getContentProviderClient().query (
+ ProviderTableMeta.CONTENT_URI,
+ null,
+ ProviderTableMeta.FILE_ACCOUNT_OWNER + "=? AND " +
+ ProviderTableMeta.FILE_PATH + " LIKE ? ",
+ new String[] { mAccount.name, folder.getRemotePath() + "%" },
+ ProviderTableMeta.FILE_PATH + " ASC "
+ );
} catch (RemoteException e) {
Log_OC.e(TAG, e.getMessage());
}
} else {
- c = getContentResolver().query(ProviderTableMeta.CONTENT_URI,
- null,
- ProviderTableMeta.FILE_ACCOUNT_OWNER + "=? AND " + ProviderTableMeta.FILE_PATH + " LIKE ? ",
- new String[] { mAccount.name, folder.getRemotePath() + "%" }, ProviderTableMeta.FILE_PATH + " ASC ");
+ c = getContentResolver().query (
+ ProviderTableMeta.CONTENT_URI,
+ null,
+ ProviderTableMeta.FILE_ACCOUNT_OWNER + "=? AND " +
+ ProviderTableMeta.FILE_PATH + " LIKE ? ",
+ new String[] { mAccount.name, folder.getRemotePath() + "%" },
+ ProviderTableMeta.FILE_PATH + " ASC "
+ );
}
/// 2. prepare a batch of update operations to change all the descendants
- ArrayList<ContentProviderOperation> operations = new ArrayList<ContentProviderOperation>(c.getCount());
+ ArrayList<ContentProviderOperation> operations =
+ new ArrayList<ContentProviderOperation>(c.getCount());
int lengthOfOldPath = folder.getRemotePath().length();
String defaultSavePath = FileStorageUtils.getSavePath(mAccount.name);
int lengthOfOldStoragePath = defaultSavePath.length() + lengthOfOldPath;
if (c.moveToFirst()) {
do {
- ContentValues cv = new ContentValues(); // don't take the constructor out of the loop and clear the object
+ ContentValues cv = new ContentValues(); // keep the constructor in the loop
OCFile child = createFileInstance(c);
- cv.put(ProviderTableMeta.FILE_PATH, newPath + child.getRemotePath().substring(lengthOfOldPath));
- if (child.getStoragePath() != null && child.getStoragePath().startsWith(defaultSavePath)) {
- cv.put(ProviderTableMeta.FILE_STORAGE_PATH, defaultSavePath + newPath + child.getStoragePath().substring(lengthOfOldStoragePath));
+ cv.put(
+ ProviderTableMeta.FILE_PATH,
+ newPath + child.getRemotePath().substring(lengthOfOldPath)
+ );
+ if ( child.getStoragePath() != null &&
+ child.getStoragePath().startsWith(defaultSavePath) ) {
+ cv.put(
+ ProviderTableMeta.FILE_STORAGE_PATH,
+ defaultSavePath + newPath +
+ child.getStoragePath().substring(lengthOfOldStoragePath)
+ );
}
- operations.add(ContentProviderOperation.newUpdate(ProviderTableMeta.CONTENT_URI).
+ operations.add(
+ ContentProviderOperation.
+ newUpdate(ProviderTableMeta.CONTENT_URI).
withValues(cv).
- withSelection( ProviderTableMeta._ID + "=?",
- new String[] { String.valueOf(child.getFileId()) })
- .build());
+ withSelection(
+ ProviderTableMeta._ID + "=?",
+ new String[] { String.valueOf(child.getFileId()) }
+ ).
+ build()
+ );
} while (c.moveToNext());
}
c.close();
}
} catch (OperationApplicationException e) {
- Log_OC.e(TAG, "Fail to update descendants of " + folder.getFileId() + " in database", e);
+ Log_OC.e(TAG, "Fail to update descendants of " +
+ folder.getFileId() + " in database", e);
} catch (RemoteException e) {
- Log_OC.e(TAG, "Fail to update desendants of " + folder.getFileId() + " in database", e);
+ Log_OC.e(TAG, "Fail to update desendants of " +
+ folder.getFileId() + " in database", e);
}
}
file.setStoragePath(c.getString(c
.getColumnIndex(ProviderTableMeta.FILE_STORAGE_PATH)));
if (file.getStoragePath() == null) {
- // try to find existing file and bind it with current account; - with the current update of SynchronizeFolderOperation, this won't be necessary anymore after a full synchronization of the account
+ // try to find existing file and bind it with current account;
+ // with the current update of SynchronizeFolderOperation, this won't be
+ // necessary anymore after a full synchronization of the account
File f = new File(FileStorageUtils.getDefaultSavePathFor(mAccount.name, file));
if (f.exists()) {
file.setStoragePath(f.getAbsolutePath());
file.setPublicLink(c.getString(c.getColumnIndex(ProviderTableMeta.FILE_PUBLIC_LINK)));
file.setPermissions(c.getString(c.getColumnIndex(ProviderTableMeta.FILE_PERMISSIONS)));
file.setRemoteId(c.getString(c.getColumnIndex(ProviderTableMeta.FILE_REMOTE_ID)));
+ file.setNeedsUpdateThumbnail(c.getInt(
+ c.getColumnIndex(ProviderTableMeta.FILE_UPDATE_THUMBNAIL)) == 1 ? true : false);
}
return file;
cv.put(ProviderTableMeta.OCSHARES_SHARED_DATE, share.getSharedDate());
cv.put(ProviderTableMeta.OCSHARES_EXPIRATION_DATE, share.getExpirationDate());
cv.put(ProviderTableMeta.OCSHARES_TOKEN, share.getToken());
- cv.put(ProviderTableMeta.OCSHARES_SHARE_WITH_DISPLAY_NAME, share.getSharedWithDisplayName());
+ cv.put(
+ ProviderTableMeta.OCSHARES_SHARE_WITH_DISPLAY_NAME,
+ share.getSharedWithDisplayName()
+ );
cv.put(ProviderTableMeta.OCSHARES_IS_DIRECTORY, share.isFolder() ? 1 : 0);
cv.put(ProviderTableMeta.OCSHARES_USER_ID, share.getUserId());
cv.put(ProviderTableMeta.OCSHARES_ID_REMOTE_SHARED, share.getIdRemoteShared());
cv.put(ProviderTableMeta.OCSHARES_ACCOUNT_OWNER, mAccount.name);
- if (shareExists(share.getIdRemoteShared())) { // for renamed files; no more delete and create
+ if (shareExists(share.getIdRemoteShared())) { // for renamed files
overriden = true;
if (getContentResolver() != null) {
share.setIsFolder(c.getInt(
c.getColumnIndex(ProviderTableMeta.OCSHARES_IS_DIRECTORY)) == 1 ? true : false);
share.setUserId(c.getLong(c.getColumnIndex(ProviderTableMeta.OCSHARES_USER_ID)));
- share.setIdRemoteShared(c.getLong(c.getColumnIndex(ProviderTableMeta.OCSHARES_ID_REMOTE_SHARED)));
+ share.setIdRemoteShared(
+ c.getLong(c.getColumnIndex(ProviderTableMeta.OCSHARES_ID_REMOTE_SHARED))
+ );
}
return share;
} else {
try {
- getContentProviderClient().update(ProviderTableMeta.CONTENT_URI, cv, where, whereArgs);
+ getContentProviderClient().update(
+ ProviderTableMeta.CONTENT_URI, cv, where, whereArgs
+ );
} catch (RemoteException e) {
Log_OC.e(TAG, "Exception in cleanSharedFiles" + e.getMessage());
ContentValues cv = new ContentValues();
cv.put(ProviderTableMeta.FILE_SHARE_BY_LINK, false);
cv.put(ProviderTableMeta.FILE_PUBLIC_LINK, "");
- String where = ProviderTableMeta.FILE_ACCOUNT_OWNER + "=? AND " + ProviderTableMeta.FILE_PARENT + "=?";
+ String where = ProviderTableMeta.FILE_ACCOUNT_OWNER + "=? AND " +
+ ProviderTableMeta.FILE_PARENT + "=?";
String [] whereArgs = new String[] { mAccount.name , String.valueOf(folder.getFileId()) };
if (getContentResolver() != null) {
} else {
try {
- getContentProviderClient().update(ProviderTableMeta.CONTENT_URI, cv, where, whereArgs);
+ getContentProviderClient().update(
+ ProviderTableMeta.CONTENT_URI, cv, where, whereArgs
+ );
} catch (RemoteException e) {
Log_OC.e(TAG, "Exception in cleanSharedFilesInFolder " + e.getMessage());
} else {
try {
- getContentProviderClient().delete(ProviderTableMeta.CONTENT_URI_SHARE, where, whereArgs);
+ getContentProviderClient().delete(
+ ProviderTableMeta.CONTENT_URI_SHARE, where, whereArgs
+ );
} catch (RemoteException e) {
Log_OC.e(TAG, "Exception in cleanShares" + e.getMessage());
public void saveShares(Collection<OCShare> shares) {
cleanShares();
if (shares != null) {
- ArrayList<ContentProviderOperation> operations = new ArrayList<ContentProviderOperation>(shares.size());
+ ArrayList<ContentProviderOperation> operations =
+ new ArrayList<ContentProviderOperation>(shares.size());
// prepare operations to insert or update files to save in the given folder
for (OCShare share : shares) {
cv.put(ProviderTableMeta.OCSHARES_SHARED_DATE, share.getSharedDate());
cv.put(ProviderTableMeta.OCSHARES_EXPIRATION_DATE, share.getExpirationDate());
cv.put(ProviderTableMeta.OCSHARES_TOKEN, share.getToken());
- cv.put(ProviderTableMeta.OCSHARES_SHARE_WITH_DISPLAY_NAME, share.getSharedWithDisplayName());
+ cv.put(
+ ProviderTableMeta.OCSHARES_SHARE_WITH_DISPLAY_NAME,
+ share.getSharedWithDisplayName()
+ );
cv.put(ProviderTableMeta.OCSHARES_IS_DIRECTORY, share.isFolder() ? 1 : 0);
cv.put(ProviderTableMeta.OCSHARES_USER_ID, share.getUserId());
cv.put(ProviderTableMeta.OCSHARES_ID_REMOTE_SHARED, share.getIdRemoteShared());
if (shareExists(share.getIdRemoteShared())) {
// updating an existing file
- operations.add(ContentProviderOperation.newUpdate(ProviderTableMeta.CONTENT_URI_SHARE).
+ operations.add(
+ ContentProviderOperation.newUpdate(ProviderTableMeta.CONTENT_URI_SHARE).
withValues(cv).
- withSelection( ProviderTableMeta.OCSHARES_ID_REMOTE_SHARED + "=?",
- new String[] { String.valueOf(share.getIdRemoteShared()) })
- .build());
+ withSelection(
+ ProviderTableMeta.OCSHARES_ID_REMOTE_SHARED + "=?",
+ new String[] { String.valueOf(share.getIdRemoteShared()) }
+ ).
+ build()
+ );
} else {
// adding a new file
- operations.add(ContentProviderOperation.newInsert(ProviderTableMeta.CONTENT_URI_SHARE).withValues(cv).build());
+ operations.add(
+ ContentProviderOperation.newInsert(ProviderTableMeta.CONTENT_URI_SHARE).
+ withValues(cv).
+ build()
+ );
}
}
if (operations.size() > 0) {
@SuppressWarnings("unused")
ContentProviderResult[] results = null;
- Log_OC.d(TAG, "Sending " + operations.size() + " operations to FileContentProvider");
+ Log_OC.d(TAG, "Sending " + operations.size() +
+ " operations to FileContentProvider");
try {
if (getContentResolver() != null) {
- results = getContentResolver().applyBatch(MainApp.getAuthority(), operations);
+ results = getContentResolver().applyBatch(
+ MainApp.getAuthority(), operations
+ );
} else {
results = getContentProviderClient().applyBatch(operations);
cleanSharedFiles();
if (sharedFiles != null) {
- ArrayList<ContentProviderOperation> operations = new ArrayList<ContentProviderOperation>(sharedFiles.size());
+ ArrayList<ContentProviderOperation> operations =
+ new ArrayList<ContentProviderOperation>(sharedFiles.size());
// prepare operations to insert or update files to save in the given folder
for (OCFile file : sharedFiles) {
ContentValues cv = new ContentValues();
cv.put(ProviderTableMeta.FILE_MODIFIED, file.getModificationTimestamp());
- cv.put(ProviderTableMeta.FILE_MODIFIED_AT_LAST_SYNC_FOR_DATA, file.getModificationTimestampAtLastSyncForData());
+ cv.put(
+ ProviderTableMeta.FILE_MODIFIED_AT_LAST_SYNC_FOR_DATA,
+ file.getModificationTimestampAtLastSyncForData()
+ );
cv.put(ProviderTableMeta.FILE_CREATION, file.getCreationTimestamp());
cv.put(ProviderTableMeta.FILE_CONTENT_LENGTH, file.getFileLength());
cv.put(ProviderTableMeta.FILE_CONTENT_TYPE, file.getMimetype());
}
cv.put(ProviderTableMeta.FILE_ACCOUNT_OWNER, mAccount.name);
cv.put(ProviderTableMeta.FILE_LAST_SYNC_DATE, file.getLastSyncDateForProperties());
- cv.put(ProviderTableMeta.FILE_LAST_SYNC_DATE_FOR_DATA, file.getLastSyncDateForData());
+ cv.put(
+ ProviderTableMeta.FILE_LAST_SYNC_DATE_FOR_DATA,
+ file.getLastSyncDateForData()
+ );
cv.put(ProviderTableMeta.FILE_KEEP_IN_SYNC, file.keepInSync() ? 1 : 0);
cv.put(ProviderTableMeta.FILE_ETAG, file.getEtag());
cv.put(ProviderTableMeta.FILE_SHARE_BY_LINK, file.isShareByLink() ? 1 : 0);
cv.put(ProviderTableMeta.FILE_PUBLIC_LINK, file.getPublicLink());
cv.put(ProviderTableMeta.FILE_PERMISSIONS, file.getPermissions());
cv.put(ProviderTableMeta.FILE_REMOTE_ID, file.getRemoteId());
+ cv.put(
+ ProviderTableMeta.FILE_UPDATE_THUMBNAIL,
+ file.needsUpdateThumbnail() ? 1 : 0
+ );
boolean existsByPath = fileExists(file.getRemotePath());
if (existsByPath || fileExists(file.getFileId())) {
// updating an existing file
- operations.add(ContentProviderOperation.newUpdate(ProviderTableMeta.CONTENT_URI).
+ operations.add(
+ ContentProviderOperation.newUpdate(ProviderTableMeta.CONTENT_URI).
withValues(cv).
- withSelection( ProviderTableMeta._ID + "=?",
- new String[] { String.valueOf(file.getFileId()) })
- .build());
+ withSelection(
+ ProviderTableMeta._ID + "=?",
+ new String[] { String.valueOf(file.getFileId()) }
+ ).build()
+ );
} else {
// adding a new file
- operations.add(ContentProviderOperation.newInsert(ProviderTableMeta.CONTENT_URI).withValues(cv).build());
+ operations.add(
+ ContentProviderOperation.newInsert(ProviderTableMeta.CONTENT_URI).
+ withValues(cv).
+ build()
+ );
}
}
if (operations.size() > 0) {
@SuppressWarnings("unused")
ContentProviderResult[] results = null;
- Log_OC.d(TAG, "Sending " + operations.size() + " operations to FileContentProvider");
+ Log_OC.d(TAG, "Sending " + operations.size() +
+ " operations to FileContentProvider");
try {
if (getContentResolver() != null) {
- results = getContentResolver().applyBatch(MainApp.getAuthority(), operations);
+ results = getContentResolver().applyBatch(
+ MainApp.getAuthority(), operations
+ );
} else {
results = getContentProviderClient().applyBatch(operations);
public void removeShare(OCShare share){
Uri share_uri = ProviderTableMeta.CONTENT_URI_SHARE;
- String where = ProviderTableMeta.OCSHARES_ACCOUNT_OWNER + "=?" + " AND " + ProviderTableMeta.FILE_PATH + "=?";
+ String where = ProviderTableMeta.OCSHARES_ACCOUNT_OWNER + "=?" + " AND " +
+ ProviderTableMeta.FILE_PATH + "=?";
String [] whereArgs = new String[]{mAccount.name, share.getPath()};
if (getContentProviderClient() != null) {
try {
cv.put(ProviderTableMeta.OCSHARES_SHARED_DATE, share.getSharedDate());
cv.put(ProviderTableMeta.OCSHARES_EXPIRATION_DATE, share.getExpirationDate());
cv.put(ProviderTableMeta.OCSHARES_TOKEN, share.getToken());
- cv.put(ProviderTableMeta.OCSHARES_SHARE_WITH_DISPLAY_NAME, share.getSharedWithDisplayName());
+ cv.put(
+ ProviderTableMeta.OCSHARES_SHARE_WITH_DISPLAY_NAME,
+ share.getSharedWithDisplayName()
+ );
cv.put(ProviderTableMeta.OCSHARES_IS_DIRECTORY, share.isFolder() ? 1 : 0);
cv.put(ProviderTableMeta.OCSHARES_USER_ID, share.getUserId());
cv.put(ProviderTableMeta.OCSHARES_ID_REMOTE_SHARED, share.getIdRemoteShared());
/*
if (shareExists(share.getIdRemoteShared())) {
// updating an existing share resource
- operations.add(ContentProviderOperation.newUpdate(ProviderTableMeta.CONTENT_URI_SHARE).
+ operations.add(
+ ContentProviderOperation.newUpdate(ProviderTableMeta.CONTENT_URI_SHARE).
withValues(cv).
withSelection( ProviderTableMeta.OCSHARES_ID_REMOTE_SHARED + "=?",
new String[] { String.valueOf(share.getIdRemoteShared()) })
} else {
*/
// adding a new share resource
- operations.add(ContentProviderOperation.newInsert(ProviderTableMeta.CONTENT_URI_SHARE).withValues(cv).build());
+ operations.add(
+ ContentProviderOperation.newInsert(ProviderTableMeta.CONTENT_URI_SHARE).
+ withValues(cv).
+ build()
+ );
//}
}
}
}
- private ArrayList<ContentProviderOperation> prepareRemoveSharesInFolder(OCFile folder, ArrayList<ContentProviderOperation> preparedOperations) {
+ private ArrayList<ContentProviderOperation> prepareRemoveSharesInFolder(
+ OCFile folder, ArrayList<ContentProviderOperation> preparedOperations
+ ) {
if (folder != null) {
- String where = ProviderTableMeta.OCSHARES_PATH + "=?" + " AND " + ProviderTableMeta.OCSHARES_ACCOUNT_OWNER + "=?";
+ String where = ProviderTableMeta.OCSHARES_PATH + "=?" + " AND "
+ + ProviderTableMeta.OCSHARES_ACCOUNT_OWNER + "=?";
String [] whereArgs = new String[]{ "", mAccount.name };
Vector<OCFile> files = getFolderContent(folder);
for (OCFile file : files) {
whereArgs[0] = file.getRemotePath();
- preparedOperations.add(ContentProviderOperation.newDelete(ProviderTableMeta.CONTENT_URI_SHARE)
- .withSelection(where, whereArgs)
- .build());
+ preparedOperations.add(
+ ContentProviderOperation.newDelete(ProviderTableMeta.CONTENT_URI_SHARE).
+ withSelection(where, whereArgs).
+ build()
+ );
}
}
return preparedOperations;
import java.io.File;
-import com.owncloud.android.utils.Log_OC;
+import com.owncloud.android.lib.common.utils.Log_OC;
import android.os.Parcel;
private String mPermissions;
private String mRemoteId;
+ private boolean mNeedsUpdateThumbnail;
+
/**
* Create new {@link OCFile} with given path.
mPublicLink = source.readString();
mPermissions = source.readString();
mRemoteId = source.readString();
+ mNeedsUpdateThumbnail = source.readInt() == 0;
+
}
@Override
dest.writeString(mPublicLink);
dest.writeString(mPermissions);
dest.writeString(mRemoteId);
+ dest.writeInt(mNeedsUpdateThumbnail ? 1 : 0);
}
/**
mPublicLink = null;
mPermissions = null;
mRemoteId = null;
+ mNeedsUpdateThumbnail = false;
}
/**
return mNeedsUpdating;
}
+ public boolean needsUpdateThumbnail() {
+ return mNeedsUpdateThumbnail;
+ }
+
+ public void setNeedsUpdateThumbnail(boolean needsUpdateThumbnail) {
+ this.mNeedsUpdateThumbnail = needsUpdateThumbnail;
+ }
+
public long getLastSyncDateForProperties() {
return mLastSyncDateForProperties;
}
--- /dev/null
+/* ownCloud Android client application
+ * Copyright (C) 2012-2014 ownCloud Inc.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2,
+ * as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
+package com.owncloud.android.datamodel;
+
+import java.io.File;
+import java.io.IOException;
+import java.lang.ref.WeakReference;
+
+import org.apache.commons.httpclient.HttpStatus;
+import org.apache.commons.httpclient.methods.GetMethod;
+
+import android.accounts.Account;
+import android.accounts.AuthenticatorException;
+import android.accounts.OperationCanceledException;
+import android.content.Context;
+import android.content.res.Resources;
+import android.graphics.Bitmap;
+import android.graphics.Bitmap.CompressFormat;
+import android.graphics.BitmapFactory;
+import android.graphics.drawable.BitmapDrawable;
+import android.graphics.drawable.Drawable;
+import android.media.ThumbnailUtils;
+import android.net.Uri;
+import android.os.AsyncTask;
+import android.util.TypedValue;
+import android.widget.ImageView;
+
+import com.owncloud.android.MainApp;
+import com.owncloud.android.lib.common.OwnCloudAccount;
+import com.owncloud.android.lib.common.OwnCloudClient;
+import com.owncloud.android.lib.common.OwnCloudClientManagerFactory;
+import com.owncloud.android.lib.common.accounts.AccountUtils.AccountNotFoundException;
+import com.owncloud.android.lib.common.utils.Log_OC;
+import com.owncloud.android.ui.adapter.DiskLruImageCache;
+import com.owncloud.android.utils.BitmapUtils;
+import com.owncloud.android.utils.DisplayUtils;
+
+/**
+ * Manager for concurrent access to thumbnails cache.
+ *
+ * @author Tobias Kaminsky
+ * @author David A. Velasco
+ */
+public class ThumbnailsCacheManager {
+
+ private static final String TAG = ThumbnailsCacheManager.class.getSimpleName();
+
+ private static final String CACHE_FOLDER = "thumbnailCache";
+
+ private static final Object mThumbnailsDiskCacheLock = new Object();
+ private static DiskLruImageCache mThumbnailCache = null;
+ private static boolean mThumbnailCacheStarting = true;
+
+ private static final int DISK_CACHE_SIZE = 1024 * 1024 * 10; // 10MB
+ private static final CompressFormat mCompressFormat = CompressFormat.JPEG;
+ private static final int mCompressQuality = 70;
+ private static OwnCloudClient mClient;
+
+ public static Bitmap mDefaultImg =
+ BitmapFactory.decodeResource(
+ MainApp.getAppContext().getResources(),
+ DisplayUtils.getResourceId("image/png", "default.png")
+ );
+
+
+ public static class InitDiskCacheTask extends AsyncTask<File, Void, Void> {
+ private static Account mAccount;
+ private static Context mContext;
+
+ public InitDiskCacheTask(Account account, Context context) {
+ mAccount = account;
+ mContext = context;
+ }
+
+ @Override
+ protected Void doInBackground(File... params) {
+ synchronized (mThumbnailsDiskCacheLock) {
+ mThumbnailCacheStarting = true;
+
+ if (mThumbnailCache == null) {
+ try {
+ OwnCloudAccount ocAccount;
+ try {
+ ocAccount = new OwnCloudAccount(mAccount, mContext);
+ mClient = OwnCloudClientManagerFactory.getDefaultSingleton().getClientFor(ocAccount, mContext);
+ } catch (AccountNotFoundException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ } catch (AuthenticatorException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ } catch (OperationCanceledException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ } catch (IOException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+
+ // Check if media is mounted or storage is built-in, if so,
+ // try and use external cache dir; otherwise use internal cache dir
+ final String cachePath =
+ MainApp.getAppContext().getExternalCacheDir().getPath() +
+ File.separator + CACHE_FOLDER;
+ Log_OC.d(TAG, "create dir: " + cachePath);
+ final File diskCacheDir = new File(cachePath);
+ mThumbnailCache = new DiskLruImageCache(
+ diskCacheDir,
+ DISK_CACHE_SIZE,
+ mCompressFormat,
+ mCompressQuality
+ );
+ } catch (Exception e) {
+ Log_OC.d(TAG, "Thumbnail cache could not be opened ", e);
+ mThumbnailCache = null;
+ }
+ }
+ mThumbnailCacheStarting = false; // Finished initialization
+ mThumbnailsDiskCacheLock.notifyAll(); // Wake any waiting threads
+ }
+ return null;
+ }
+ }
+
+
+ public static void addBitmapToCache(String key, Bitmap bitmap) {
+ synchronized (mThumbnailsDiskCacheLock) {
+ if (mThumbnailCache != null) {
+ mThumbnailCache.put(key, bitmap);
+ }
+ }
+ }
+
+
+ public static Bitmap getBitmapFromDiskCache(String key) {
+ synchronized (mThumbnailsDiskCacheLock) {
+ // Wait while disk cache is started from background thread
+ while (mThumbnailCacheStarting) {
+ try {
+ mThumbnailsDiskCacheLock.wait();
+ } catch (InterruptedException e) {}
+ }
+ if (mThumbnailCache != null) {
+ return (Bitmap) mThumbnailCache.getBitmap(key);
+ }
+ }
+ return null;
+ }
+
+
+ public static boolean cancelPotentialWork(OCFile file, ImageView imageView) {
+ final ThumbnailGenerationTask bitmapWorkerTask = getBitmapWorkerTask(imageView);
+
+ if (bitmapWorkerTask != null) {
+ final OCFile bitmapData = bitmapWorkerTask.mFile;
+ // If bitmapData is not yet set or it differs from the new data
+ if (bitmapData == null || bitmapData != file) {
+ // Cancel previous task
+ bitmapWorkerTask.cancel(true);
+ } else {
+ // The same work is already in progress
+ return false;
+ }
+ }
+ // No task associated with the ImageView, or an existing task was cancelled
+ return true;
+ }
+
+ public static ThumbnailGenerationTask getBitmapWorkerTask(ImageView imageView) {
+ if (imageView != null) {
+ final Drawable drawable = imageView.getDrawable();
+ if (drawable instanceof AsyncDrawable) {
+ final AsyncDrawable asyncDrawable = (AsyncDrawable) drawable;
+ return asyncDrawable.getBitmapWorkerTask();
+ }
+ }
+ return null;
+ }
+
+ public static class ThumbnailGenerationTask extends AsyncTask<OCFile, Void, Bitmap> {
+ private final WeakReference<ImageView> mImageViewReference;
+ private OCFile mFile;
+ private FileDataStorageManager mStorageManager;
+
+ public ThumbnailGenerationTask(ImageView imageView, FileDataStorageManager storageManager) {
+ // Use a WeakReference to ensure the ImageView can be garbage collected
+ mImageViewReference = new WeakReference<ImageView>(imageView);
+ if (storageManager == null)
+ throw new IllegalArgumentException("storageManager must not be NULL");
+ mStorageManager = storageManager;
+ }
+
+ // Decode image in background.
+ @Override
+ protected Bitmap doInBackground(OCFile... params) {
+ Bitmap thumbnail = null;
+
+ try {
+ mFile = params[0];
+ final String imageKey = String.valueOf(mFile.getRemoteId());
+
+ // Check disk cache in background thread
+ thumbnail = getBitmapFromDiskCache(imageKey);
+
+ // Not found in disk cache
+ if (thumbnail == null || mFile.needsUpdateThumbnail()) {
+ // Converts dp to pixel
+ Resources r = MainApp.getAppContext().getResources();
+ int px = (int) Math.round(TypedValue.applyDimension(
+ TypedValue.COMPLEX_UNIT_DIP, 150, r.getDisplayMetrics()
+ ));
+
+ if (mFile.isDown()){
+ Bitmap bitmap = BitmapUtils.decodeSampledBitmapFromFile(
+ mFile.getStoragePath(), px, px);
+
+ if (bitmap != null) {
+ thumbnail = ThumbnailUtils.extractThumbnail(bitmap, px, px);
+
+ // Add thumbnail to cache
+ addBitmapToCache(imageKey, thumbnail);
+
+ mFile.setNeedsUpdateThumbnail(false);
+ mStorageManager.saveFile(mFile);
+ }
+
+ } else {
+ // Download thumbnail from server
+ try {
+ int status = -1;
+
+ String uri = mClient.getBaseUri() + "/index.php/apps/files/api/v1/thumbnail/" + px + "/" + px
+ + Uri.encode(mFile.getRemotePath(), "/");
+ Log_OC.d("Thumbnail", "URI: " + uri);
+ GetMethod get = new GetMethod(uri);
+ status = mClient.executeMethod(get);
+ if (status == HttpStatus.SC_OK) {
+ byte[] bytes = get.getResponseBody();
+ Bitmap bitmap = BitmapFactory.decodeByteArray(bytes, 0, bytes.length);
+ thumbnail = ThumbnailUtils.extractThumbnail(bitmap, px, px);
+
+ // Add thumbnail to cache
+ if (thumbnail != null) {
+ addBitmapToCache(imageKey, thumbnail);
+ }
+ }
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ }
+ }
+
+ } catch (Throwable t) {
+ // the app should never break due to a problem with thumbnails
+ Log_OC.e(TAG, "Generation of thumbnail for " + mFile + " failed", t);
+ if (t instanceof OutOfMemoryError) {
+ System.gc();
+ }
+ }
+
+ return thumbnail;
+ }
+
+ protected void onPostExecute(Bitmap bitmap){
+ if (isCancelled()) {
+ bitmap = null;
+ }
+
+ if (mImageViewReference != null && bitmap != null) {
+ final ImageView imageView = mImageViewReference.get();
+ final ThumbnailGenerationTask bitmapWorkerTask =
+ getBitmapWorkerTask(imageView);
+ if (this == bitmapWorkerTask && imageView != null) {
+ if (imageView.getTag().equals(mFile.getFileId())) {
+ imageView.setImageBitmap(bitmap);
+ }
+ }
+ }
+ }
+ }
+
+
+ public static class AsyncDrawable extends BitmapDrawable {
+ private final WeakReference<ThumbnailGenerationTask> bitmapWorkerTaskReference;
+
+ public AsyncDrawable(
+ Resources res, Bitmap bitmap, ThumbnailGenerationTask bitmapWorkerTask
+ ) {
+
+ super(res, bitmap);
+ bitmapWorkerTaskReference =
+ new WeakReference<ThumbnailGenerationTask>(bitmapWorkerTask);
+ }
+
+ public ThumbnailGenerationTask getBitmapWorkerTask() {
+ return bitmapWorkerTaskReference.get();
+ }
+ }
+
+
+ /**
+ * Remove from cache the remoteId passed
+ * @param fileRemoteId: remote id of mFile passed
+ */
+ public static void removeFileFromCache(String fileRemoteId){
+ synchronized (mThumbnailsDiskCacheLock) {
+ if (mThumbnailCache != null) {
+ mThumbnailCache.removeKey(fileRemoteId);
+ }
+ mThumbnailsDiskCacheLock.notifyAll(); // Wake any waiting threads
+ }
+ }
+
+}
package com.owncloud.android.db;
import com.owncloud.android.MainApp;
-import com.owncloud.android.utils.Log_OC;
+import com.owncloud.android.lib.common.utils.Log_OC;
import android.content.ContentValues;
import android.content.Context;
public class ProviderMeta {\r
\r
public static final String DB_NAME = "filelist";\r
- public static final int DB_VERSION = 7;\r
+ public static final int DB_VERSION = 8;\r
\r
private ProviderMeta() {\r
}\r
public static final String FILE_PUBLIC_LINK = "public_link";\r
public static final String FILE_PERMISSIONS = "permissions";\r
public static final String FILE_REMOTE_ID = "remote_id";\r
+ public static final String FILE_UPDATE_THUMBNAIL = "update_thumbnail";\r
\r
public static final String FILE_DEFAULT_SORT_ORDER = FILE_NAME\r
+ " collate nocase asc";\r
package com.owncloud.android.files;
+import com.owncloud.android.lib.common.utils.Log_OC;
import com.owncloud.android.services.observer.FileObserverService;
-import com.owncloud.android.utils.Log_OC;
import android.content.BroadcastReceiver;
import android.content.Context;
import com.owncloud.android.lib.common.accounts.AccountUtils.Constants;
import com.owncloud.android.lib.common.network.WebdavUtils;
+import com.owncloud.android.lib.common.utils.Log_OC;
import com.owncloud.android.lib.resources.status.OwnCloudVersion;
import com.owncloud.android.services.OperationsService;
import com.owncloud.android.ui.activity.FileActivity;
import com.owncloud.android.ui.dialog.ShareLinkToDialog;
-import com.owncloud.android.utils.Log_OC;
/**
*
import com.owncloud.android.authentication.AccountUtils;
import com.owncloud.android.db.DbHandler;
import com.owncloud.android.files.services.FileUploader;
+import com.owncloud.android.lib.common.utils.Log_OC;
import com.owncloud.android.utils.FileStorageUtils;
-import com.owncloud.android.utils.Log_OC;
import android.accounts.Account;
import com.owncloud.android.notifications.NotificationDelayer;
import com.owncloud.android.lib.common.operations.RemoteOperationResult;
import com.owncloud.android.lib.common.operations.RemoteOperationResult.ResultCode;
+import com.owncloud.android.lib.common.utils.Log_OC;
import com.owncloud.android.lib.resources.files.FileUtils;
import com.owncloud.android.operations.DownloadFileOperation;
import com.owncloud.android.ui.activity.FileActivity;
import com.owncloud.android.ui.preview.PreviewImageActivity;
import com.owncloud.android.ui.preview.PreviewImageFragment;
import com.owncloud.android.utils.ErrorMessageAdapter;
-import com.owncloud.android.utils.Log_OC;
import android.accounts.Account;
import android.accounts.AccountsException;
long syncDate = System.currentTimeMillis();
file.setLastSyncDateForProperties(syncDate);
file.setLastSyncDateForData(syncDate);
+ file.setNeedsUpdateThumbnail(true);
file.setModificationTimestamp(mCurrentDownload.getModificationTimestamp());
file.setModificationTimestampAtLastSyncForData(mCurrentDownload.getModificationTimestamp());
// file.setEtag(mCurrentDownload.getEtag()); // TODO Etag, where available
file.setMimetype(mCurrentDownload.getMimeType());
file.setStoragePath(mCurrentDownload.getSavePath());
file.setFileLength((new File(mCurrentDownload.getSavePath()).length()));
+ file.setRemoteId(mCurrentDownload.getFile().getRemoteId());
mStorageManager.saveFile(file);
}
import com.owncloud.android.lib.common.operations.RemoteOperation;
import com.owncloud.android.lib.common.operations.RemoteOperationResult;
import com.owncloud.android.lib.common.operations.RemoteOperationResult.ResultCode;
+import com.owncloud.android.lib.common.utils.Log_OC;
import com.owncloud.android.lib.resources.files.ExistenceCheckRemoteOperation;
import com.owncloud.android.lib.resources.files.FileUtils;
import com.owncloud.android.lib.resources.files.ReadRemoteFileOperation;
import com.owncloud.android.ui.activity.FileActivity;
import com.owncloud.android.ui.activity.FileDisplayActivity;
import com.owncloud.android.utils.ErrorMessageAdapter;
-import com.owncloud.android.utils.Log_OC;
// coincidence; nothing else is needed, the storagePath is right
// in the instance returned by mCurrentUpload.getFile()
}
-
+ file.setNeedsUpdateThumbnail(true);
mStorageManager.saveFile(file);
}
file.setModificationTimestamp(remoteFile.getModifiedTimestamp());
file.setModificationTimestampAtLastSyncForData(remoteFile.getModifiedTimestamp());
// file.setEtag(remoteFile.getEtag()); // TODO Etag, where available
+ file.setRemoteId(remoteFile.getRemoteId());
}
private OCFile obtainNewOCFileToUpload(String remotePath, String localPath, String mimeType,
import com.owncloud.android.R;
import com.owncloud.android.datamodel.OCFile;
+import com.owncloud.android.lib.common.utils.Log_OC;
import com.owncloud.android.ui.activity.FileActivity;
import com.owncloud.android.ui.activity.FileDisplayActivity;
-import com.owncloud.android.utils.Log_OC;
/**
import com.owncloud.android.datamodel.OCFile;
+import com.owncloud.android.lib.common.utils.Log_OC;
import com.owncloud.android.media.MediaService.State;
-import com.owncloud.android.utils.Log_OC;
import android.accounts.Account;
import android.content.Intent;
import com.owncloud.android.lib.common.operations.OnRemoteOperationListener;
import com.owncloud.android.lib.common.operations.RemoteOperation;
import com.owncloud.android.lib.common.operations.RemoteOperationResult;
+import com.owncloud.android.lib.common.utils.Log_OC;
import com.owncloud.android.operations.common.SyncOperation;
import com.owncloud.android.utils.FileStorageUtils;
-import com.owncloud.android.utils.Log_OC;
/**
}
}
-
/**
* Save new directory in local database
*/
public void saveFolderInDB() {
- OCFile newDir = new OCFile(mRemotePath);
- newDir.setMimetype("DIR");
- long parentId = getStorageManager().getFileByPath(FileStorageUtils.getParentPath(mRemotePath)).getFileId();
- newDir.setParentId(parentId);
- newDir.setModificationTimestamp(System.currentTimeMillis());
- getStorageManager().saveFile(newDir);
+ if (mCreateFullPath && getStorageManager().
+ getFileByPath(FileStorageUtils.getParentPath(mRemotePath)) == null){// When parent
+ // of remote path
+ // is not created
+ String[] subFolders = mRemotePath.split("/");
+ String composedRemotePath = "/";
- Log_OC.d(TAG, "Create directory " + mRemotePath + " in Database");
+ // For each antecesor folders create them recursively
+ for (int i=0; i<subFolders.length; i++) {
+ String subFolder = subFolders[i];
+ if (!subFolder.isEmpty()) {
+ composedRemotePath = composedRemotePath + subFolder + "/";
+ mRemotePath = composedRemotePath;
+ saveFolderInDB();
+ }
+ }
+ } else { // Create directory on DB
+ OCFile newDir = new OCFile(mRemotePath);
+ newDir.setMimetype("DIR");
+ long parentId = getStorageManager().
+ getFileByPath(FileStorageUtils.getParentPath(mRemotePath)).getFileId();
+ newDir.setParentId(parentId);
+ newDir.setModificationTimestamp(System.currentTimeMillis());
+ getStorageManager().saveFile(newDir);
+ Log_OC.d(TAG, "Create directory " + mRemotePath + " in Database");
+ }
}
-
-
}
import com.owncloud.android.lib.resources.shares.OCShare;
import com.owncloud.android.lib.common.operations.RemoteOperation;
import com.owncloud.android.lib.common.operations.RemoteOperationResult;
+import com.owncloud.android.lib.common.utils.Log_OC;
import com.owncloud.android.lib.resources.shares.GetRemoteSharesForFileOperation;
import com.owncloud.android.lib.resources.shares.ShareType;
import com.owncloud.android.lib.resources.shares.CreateRemoteShareOperation;
import com.owncloud.android.lib.resources.files.FileUtils;
import com.owncloud.android.operations.common.SyncOperation;
-import com.owncloud.android.utils.Log_OC;
public class CreateShareOperation extends SyncOperation {
import com.owncloud.android.lib.common.operations.RemoteOperation;
import com.owncloud.android.lib.common.operations.RemoteOperationResult;
import com.owncloud.android.lib.common.operations.RemoteOperationResult.ResultCode;
+import com.owncloud.android.lib.common.utils.Log_OC;
import com.owncloud.android.lib.resources.files.ExistenceCheckRemoteOperation;
import android.content.Context;
authMethod = AuthenticationMethod.SAML_WEB_SSO;
}
// else - fall back to UNKNOWN
- Log.d(TAG, "Authentication method found: " + authenticationMethodToString(authMethod));
+ Log_OC.d(TAG, "Authentication method found: " + authenticationMethodToString(authMethod));
if (!authMethod.equals(AuthenticationMethod.UNKNOWN)) {
result = new RemoteOperationResult(true, result.getHttpCode(), null);
import com.owncloud.android.lib.common.operations.OperationCancelledException;
import com.owncloud.android.lib.common.operations.RemoteOperation;
import com.owncloud.android.lib.common.operations.RemoteOperationResult;
+import com.owncloud.android.lib.common.utils.Log_OC;
import com.owncloud.android.lib.resources.files.DownloadRemoteFileOperation;
import com.owncloud.android.utils.FileStorageUtils;
-import com.owncloud.android.utils.Log_OC;
import android.accounts.Account;
import android.webkit.MimeTypeMap;
import com.owncloud.android.lib.common.operations.RemoteOperation;
import com.owncloud.android.lib.common.operations.RemoteOperationResult;
import com.owncloud.android.lib.common.operations.RemoteOperationResult.ResultCode;
+import com.owncloud.android.lib.common.utils.Log_OC;
import com.owncloud.android.lib.resources.status.GetRemoteStatusOperation;
import com.owncloud.android.lib.resources.status.OwnCloudVersion;
import com.owncloud.android.operations.DetectAuthenticationMethodOperation.AuthenticationMethod;
-import com.owncloud.android.utils.Log_OC;
import android.content.Context;
import com.owncloud.android.lib.common.OwnCloudClient;
import com.owncloud.android.lib.resources.shares.OCShare;
import com.owncloud.android.lib.common.operations.RemoteOperationResult;
+import com.owncloud.android.lib.common.utils.Log_OC;
import com.owncloud.android.lib.resources.shares.GetRemoteSharesForFileOperation;
import com.owncloud.android.operations.common.SyncOperation;
-import com.owncloud.android.utils.Log_OC;
/**
* Provide a list shares for a specific file.
import com.owncloud.android.lib.common.OwnCloudClient;
import com.owncloud.android.lib.common.operations.RemoteOperationResult;
+import com.owncloud.android.lib.common.utils.Log_OC;
import com.owncloud.android.lib.resources.shares.OCShare;
import com.owncloud.android.lib.resources.shares.GetRemoteSharesOperation;
import com.owncloud.android.operations.common.SyncOperation;
-import com.owncloud.android.utils.Log_OC;
/**
* Access to remote operation to get the share files/folders
import com.owncloud.android.lib.common.operations.RemoteOperation;
import com.owncloud.android.lib.common.operations.RemoteOperationResult;
import com.owncloud.android.lib.common.operations.RemoteOperationResult.ResultCode;
-import com.owncloud.android.utils.Log_OC;
+import com.owncloud.android.lib.common.utils.Log_OC;
public class OAuth2GetAccessToken extends RemoteOperation {
import com.owncloud.android.lib.common.OwnCloudClient;
import com.owncloud.android.lib.common.operations.RemoteOperationResult;
import com.owncloud.android.lib.common.operations.RemoteOperationResult.ResultCode;
+import com.owncloud.android.lib.common.utils.Log_OC;
import com.owncloud.android.lib.resources.files.RenameRemoteFileOperation;
import com.owncloud.android.operations.common.SyncOperation;
import com.owncloud.android.utils.FileStorageUtils;
-import com.owncloud.android.utils.Log_OC;
import android.accounts.Account;
import com.owncloud.android.lib.resources.files.RemoteFile;
import com.owncloud.android.lib.common.operations.RemoteOperationResult;
import com.owncloud.android.lib.common.operations.RemoteOperationResult.ResultCode;
+import com.owncloud.android.lib.common.utils.Log_OC;
import com.owncloud.android.lib.resources.files.ReadRemoteFileOperation;
import com.owncloud.android.operations.common.SyncOperation;
import com.owncloud.android.utils.FileStorageUtils;
-import com.owncloud.android.utils.Log_OC;
import android.accounts.Account;
import android.content.Context;
result = new RemoteOperationResult(ResultCode.OK);
} else if (serverChanged) {
+ mLocalFile.setRemoteId(mServerFile.getRemoteId());
+
if (mSyncFileContents) {
requestForDownload(mLocalFile); // local, not server; we won't to keep the value of keepInSync!
// the update of local data will be done later by the FileUploader service when the upload finishes
import com.owncloud.android.lib.common.operations.RemoteOperation;
import com.owncloud.android.lib.common.operations.RemoteOperationResult;
import com.owncloud.android.lib.common.operations.RemoteOperationResult.ResultCode;
+import com.owncloud.android.lib.common.utils.Log_OC;
import com.owncloud.android.lib.resources.shares.GetRemoteSharesForFileOperation;
import com.owncloud.android.lib.resources.files.FileUtils;
import com.owncloud.android.lib.resources.files.ReadRemoteFileOperation;
import com.owncloud.android.syncadapter.FileSyncAdapter;
import com.owncloud.android.utils.FileStorageUtils;
-import com.owncloud.android.utils.Log_OC;
private static final String TAG = SynchronizeFolderOperation.class.getSimpleName();
- public static final String EVENT_SINGLE_FOLDER_CONTENTS_SYNCED = SynchronizeFolderOperation.class.getName() + ".EVENT_SINGLE_FOLDER_CONTENTS_SYNCED";
- public static final String EVENT_SINGLE_FOLDER_SHARES_SYNCED = SynchronizeFolderOperation.class.getName() + ".EVENT_SINGLE_FOLDER_SHARES_SYNCED";
+ public static final String EVENT_SINGLE_FOLDER_CONTENTS_SYNCED =
+ SynchronizeFolderOperation.class.getName() + ".EVENT_SINGLE_FOLDER_CONTENTS_SYNCED";
+ public static final String EVENT_SINGLE_FOLDER_SHARES_SYNCED =
+ SynchronizeFolderOperation.class.getName() + ".EVENT_SINGLE_FOLDER_SHARES_SYNCED";
/** Time stamp for the synchronization process in progress */
private long mCurrentSyncTime;
/** Counter of failed operations in synchronization of kept-in-sync files */
private int mFailsInFavouritesFound;
- /** Map of remote and local paths to files that where locally stored in a location out of the ownCloud folder and couldn't be copied automatically into it */
+ /**
+ * Map of remote and local paths to files that where locally stored in a location
+ * out of the ownCloud folder and couldn't be copied automatically into it
+ **/
private Map<String, String> mForgottenLocalFiles;
/** 'True' means that this operation is part of a full account synchronization */
private boolean mSyncFullAccount;
- /** 'True' means that Share resources bound to the files into the folder should be refreshed also */
+ /** 'True' means that Share resources bound to the files into should be refreshed also */
private boolean mIsShareSupported;
- /** 'True' means that the remote folder changed from last synchronization and should be fetched */
+ /** 'True' means that the remote folder changed and should be fetched */
private boolean mRemoteFolderChanged;
+ /** 'True' means that Etag will be ignored */
+ private boolean mIgnoreETag;
+
/**
* Creates a new instance of {@link SynchronizeFolderOperation}.
*
* @param remoteFolderPath Remote folder to synchronize.
* @param currentSyncTime Time stamp for the synchronization process in progress.
- * @param localFolderId Identifier in the local database of the folder to synchronize.
- * @param updateFolderProperties 'True' means that the properties of the folder should be updated also, not just its content.
- * @param syncFullAccount 'True' means that this operation is part of a full account synchronization.
+ * @param localFolderId Identifier in the local database of the folder
+ * to synchronize.
+ * @param updateFolderProperties 'True' means that the properties of the folder should
+ * be updated also, not just its content.
+ * @param syncFullAccount 'True' means that this operation is part of a full account
+ * synchronization.
* @param dataStorageManager Interface with the local database.
* @param account ownCloud account where the folder is located.
* @param context Application context.
long currentSyncTime,
boolean syncFullAccount,
boolean isShareSupported,
+ boolean ignoreETag,
FileDataStorageManager dataStorageManager,
Account account,
Context context ) {
mContext = context;
mForgottenLocalFiles = new HashMap<String, String>();
mRemoteFolderChanged = false;
+ mIgnoreETag = ignoreETag;
}
}
/**
- * Returns the list of files and folders contained in the synchronized folder, if called after synchronization is complete.
+ * Returns the list of files and folders contained in the synchronized folder,
+ * if called after synchronization is complete.
*
* @return List of files and folders contained in the synchronized folder.
*/
}
if (!mSyncFullAccount) {
- sendLocalBroadcast(EVENT_SINGLE_FOLDER_CONTENTS_SYNCED, mLocalFolder.getRemotePath(), result);
+ sendLocalBroadcast(
+ EVENT_SINGLE_FOLDER_CONTENTS_SYNCED, mLocalFolder.getRemotePath(), result
+ );
}
if (result.isSuccess() && mIsShareSupported && !mSyncFullAccount) {
}
if (!mSyncFullAccount) {
- sendLocalBroadcast(EVENT_SINGLE_FOLDER_SHARES_SYNCED, mLocalFolder.getRemotePath(), result);
+ sendLocalBroadcast(
+ EVENT_SINGLE_FOLDER_SHARES_SYNCED, mLocalFolder.getRemotePath(), result
+ );
}
return result;
private RemoteOperationResult checkForChanges(OwnCloudClient client) {
- mRemoteFolderChanged = false;
+ mRemoteFolderChanged = true;
RemoteOperationResult result = null;
String remotePath = null;
result = operation.execute(client);
if (result.isSuccess()){
OCFile remoteFolder = FileStorageUtils.fillOCFile((RemoteFile) result.getData().get(0));
-
- // check if remote and local folder are different
- mRemoteFolderChanged = !(remoteFolder.getEtag().equalsIgnoreCase(mLocalFolder.getEtag()));
-
+
+ if (!mIgnoreETag) {
+ // check if remote and local folder are different
+ mRemoteFolderChanged =
+ !(remoteFolder.getEtag().equalsIgnoreCase(mLocalFolder.getEtag()));
+ }
+
result = new RemoteOperationResult(ResultCode.OK);
- Log_OC.i(TAG, "Checked " + mAccount.name + remotePath + " : " + (mRemoteFolderChanged ? "changed" : "not changed"));
+ Log_OC.i(TAG, "Checked " + mAccount.name + remotePath + " : " +
+ (mRemoteFolderChanged ? "changed" : "not changed"));
} else {
// check failed
removeLocalFolder();
}
if (result.isException()) {
- Log_OC.e(TAG, "Checked " + mAccount.name + remotePath + " : " + result.getLogMessage(), result.getException());
+ Log_OC.e(TAG, "Checked " + mAccount.name + remotePath + " : " +
+ result.getLogMessage(), result.getException());
} else {
- Log_OC.e(TAG, "Checked " + mAccount.name + remotePath + " : " + result.getLogMessage());
+ Log_OC.e(TAG, "Checked " + mAccount.name + remotePath + " : " +
+ result.getLogMessage());
}
}
if (result.isSuccess()) {
synchronizeData(result.getData(), client);
if (mConflictsFound > 0 || mFailsInFavouritesFound > 0) {
- result = new RemoteOperationResult(ResultCode.SYNC_CONFLICT); // should be different result, but will do the job
+ result = new RemoteOperationResult(ResultCode.SYNC_CONFLICT);
+ // should be a different result code, but will do the job
}
} else {
if (result.getCode() == ResultCode.FILE_NOT_FOUND)
private void removeLocalFolder() {
if (mStorageManager.fileExists(mLocalFolder.getFileId())) {
String currentSavePath = FileStorageUtils.getSavePath(mAccount.name);
- mStorageManager.removeFolder(mLocalFolder, true, (mLocalFolder.isDown() && mLocalFolder.getStoragePath().startsWith(currentSavePath)));
+ mStorageManager.removeFolder(
+ mLocalFolder,
+ true,
+ ( mLocalFolder.isDown() &&
+ mLocalFolder.getStoragePath().startsWith(currentSavePath)
+ )
+ );
}
}
*
* @param client Client instance to the remote server where the data were
* retrieved.
- * @return 'True' when any change was made in the local data, 'false' otherwise.
+ * @return 'True' when any change was made in the local data, 'false' otherwise
*/
private void synchronizeData(ArrayList<Object> folderAndFiles, OwnCloudClient client) {
// get 'fresh data' from the database
remoteFolder.setParentId(mLocalFolder.getParentId());
remoteFolder.setFileId(mLocalFolder.getFileId());
- Log_OC.d(TAG, "Remote folder " + mLocalFolder.getRemotePath() + " changed - starting update of local data ");
+ Log_OC.d(TAG, "Remote folder " + mLocalFolder.getRemotePath()
+ + " changed - starting update of local data ");
List<OCFile> updatedFiles = new Vector<OCFile>(folderAndFiles.size() - 1);
List<SynchronizeFileOperation> filesToSyncContents = new Vector<SynchronizeFileOperation>();
remoteFile.setParentId(mLocalFolder.getFileId());
/// retrieve local data for the read file
- //localFile = mStorageManager.getFileByPath(remoteFile.getRemotePath());
+ // localFile = mStorageManager.getFileByPath(remoteFile.getRemotePath());
localFile = localFilesMap.remove(remoteFile.getRemotePath());
- /// add to the remoteFile (the new one) data about LOCAL STATE (not existing in the server side)
+ /// add to the remoteFile (the new one) data about LOCAL STATE (not existing in server)
remoteFile.setLastSyncDateForProperties(mCurrentSyncTime);
if (localFile != null) {
// some properties of local state are kept unmodified
remoteFile.setFileId(localFile.getFileId());
remoteFile.setKeepInSync(localFile.keepInSync());
remoteFile.setLastSyncDateForData(localFile.getLastSyncDateForData());
- remoteFile.setModificationTimestampAtLastSyncForData(localFile.getModificationTimestampAtLastSyncForData());
+ remoteFile.setModificationTimestampAtLastSyncForData(
+ localFile.getModificationTimestampAtLastSyncForData()
+ );
remoteFile.setStoragePath(localFile.getStoragePath());
- remoteFile.setEtag(localFile.getEtag()); // eTag will not be updated unless contents are synchronized (Synchronize[File|Folder]Operation with remoteFile as parameter)
+ // eTag will not be updated unless contents are synchronized
+ // (Synchronize[File|Folder]Operation with remoteFile as parameter)
+ remoteFile.setEtag(localFile.getEtag());
if (remoteFile.isFolder()) {
- remoteFile.setFileLength(localFile.getFileLength()); // TODO move operations about size of folders to FileContentProvider
+ remoteFile.setFileLength(localFile.getFileLength());
+ // TODO move operations about size of folders to FileContentProvider
}
remoteFile.setPublicLink(localFile.getPublicLink());
remoteFile.setShareByLink(localFile.isShareByLink());
} else {
- remoteFile.setEtag(""); // remote eTag will not be updated unless contents are synchronized (Synchronize[File|Folder]Operation with remoteFile as parameter)
+ // remote eTag will not be updated unless contents are synchronized
+ // (Synchronize[File|Folder]Operation with remoteFile as parameter)
+ remoteFile.setEtag("");
}
/// check and fix, if needed, local storage path
- checkAndFixForeignStoragePath(remoteFile); // fixing old policy - now local files must be copied into the ownCloud local folder
+ checkAndFixForeignStoragePath(remoteFile); // policy - local files are COPIED
+ // into the ownCloud local folder;
searchForLocalFileInDefaultPath(remoteFile); // legacy
/// prepare content synchronization for kept-in-sync files
updatedFiles.add(remoteFile);
}
- // save updated contents in local database; all at once, trying to get a best performance in database update (not a big deal, indeed)
+ // save updated contents in local database
mStorageManager.saveFolder(remoteFolder, updatedFiles, localFilesMap.values());
// request for the synchronization of file contents AFTER saving current remote properties
}
/**
- * Performs a list of synchronization operations, determining if a download or upload is needed or
- * if exists conflict due to changes both in local and remote contents of the each file.
+ * Performs a list of synchronization operations, determining if a download or upload is needed
+ * or if exists conflict due to changes both in local and remote contents of the each file.
*
- * If download or upload is needed, request the operation to the corresponding service and goes on.
+ * If download or upload is needed, request the operation to the corresponding service and goes
+ * on.
*
* @param filesToSyncContents Synchronization operations to execute.
* @param client Interface to the remote ownCloud server.
*/
- private void startContentSynchronizations(List<SynchronizeFileOperation> filesToSyncContents, OwnCloudClient client) {
+ private void startContentSynchronizations(
+ List<SynchronizeFileOperation> filesToSyncContents, OwnCloudClient client
+ ) {
RemoteOperationResult contentsResult = null;
for (SynchronizeFileOperation op: filesToSyncContents) {
- contentsResult = op.execute(mStorageManager, mContext); // returns without waiting for upload or download finishes
+ contentsResult = op.execute(mStorageManager, mContext); // async
if (!contentsResult.isSuccess()) {
if (contentsResult.getCode() == ResultCode.SYNC_CONFLICT) {
mConflictsFound++;
} else {
mFailsInFavouritesFound++;
if (contentsResult.getException() != null) {
- Log_OC.e(TAG, "Error while synchronizing favourites : " + contentsResult.getLogMessage(), contentsResult.getException());
+ Log_OC.e(TAG, "Error while synchronizing favourites : "
+ + contentsResult.getLogMessage(), contentsResult.getException());
} else {
- Log_OC.e(TAG, "Error while synchronizing favourites : " + contentsResult.getLogMessage());
+ Log_OC.e(TAG, "Error while synchronizing favourites : "
+ + contentsResult.getLogMessage());
}
}
} // won't let these fails break the synchronization process
/**
- * Checks the storage path of the OCFile received as parameter. If it's out of the local ownCloud folder,
- * tries to copy the file inside it.
+ * Checks the storage path of the OCFile received as parameter.
+ * If it's out of the local ownCloud folder, tries to copy the file inside it.
*
- * If the copy fails, the link to the local file is nullified. The account of forgotten files is kept in
- * {@link #mForgottenLocalFiles}
+ * If the copy fails, the link to the local file is nullified. The account of forgotten
+ * files is kept in {@link #mForgottenLocalFiles}
*)
* @param file File to check and fix.
*/
File expectedParent = expectedFile.getParentFile();
expectedParent.mkdirs();
if (!expectedParent.isDirectory()) {
- throw new IOException("Unexpected error: parent directory could not be created");
+ throw new IOException(
+ "Unexpected error: parent directory could not be created"
+ );
}
expectedFile.createNewFile();
if (!expectedFile.isFile()) {
try {
if (in != null) in.close();
} catch (Exception e) {
- Log_OC.d(TAG, "Weird exception while closing input stream for " + storagePath + " (ignoring)", e);
+ Log_OC.d(TAG, "Weird exception while closing input stream for "
+ + storagePath + " (ignoring)", e);
}
try {
if (out != null) out.close();
} catch (Exception e) {
- Log_OC.d(TAG, "Weird exception while closing output stream for " + expectedPath + " (ignoring)", e);
+ Log_OC.d(TAG, "Weird exception while closing output stream for "
+ + expectedPath + " (ignoring)", e);
}
}
}
RemoteOperationResult result = null;
// remote request
- GetRemoteSharesForFileOperation operation = new GetRemoteSharesForFileOperation(mLocalFolder.getRemotePath(), false, true);
+ GetRemoteSharesForFileOperation operation =
+ new GetRemoteSharesForFileOperation(mLocalFolder.getRemotePath(), false, true);
result = operation.execute(client);
if (result.isSuccess()) {
/**
- * Sends a message to any application component interested in the progress of the synchronization.
+ * Sends a message to any application component interested in the progress
+ * of the synchronization.
*
* @param event
- * @param dirRemotePath Remote path of a folder that was just synchronized (with or without success)
+ * @param dirRemotePath Remote path of a folder that was just synchronized
+ * (with or without success)
* @param result
*/
- private void sendLocalBroadcast(String event, String dirRemotePath, RemoteOperationResult result) {
+ private void sendLocalBroadcast(
+ String event, String dirRemotePath, RemoteOperationResult result
+ ) {
Log_OC.d(TAG, "Send broadcast " + event);
Intent intent = new Intent(event);
intent.putExtra(FileSyncAdapter.EXTRA_ACCOUNT_NAME, mAccount.name);
import com.owncloud.android.lib.common.OwnCloudClient;
import com.owncloud.android.lib.common.operations.RemoteOperationResult;
import com.owncloud.android.lib.common.operations.RemoteOperationResult.ResultCode;
+import com.owncloud.android.lib.common.utils.Log_OC;
import com.owncloud.android.lib.resources.files.ExistenceCheckRemoteOperation;
import com.owncloud.android.lib.resources.shares.OCShare;
import com.owncloud.android.lib.resources.shares.RemoveRemoteShareOperation;
import com.owncloud.android.lib.resources.shares.ShareType;
import com.owncloud.android.operations.common.SyncOperation;
-import com.owncloud.android.utils.Log_OC;
/**
* Unshare file/folder
import com.owncloud.android.lib.common.operations.RemoteOperation;
import com.owncloud.android.lib.common.operations.RemoteOperationResult;
import com.owncloud.android.lib.common.operations.RemoteOperationResult.ResultCode;
+import com.owncloud.android.lib.common.utils.Log_OC;
import com.owncloud.android.lib.resources.status.OwnCloudVersion;
-import com.owncloud.android.utils.Log_OC;
import android.accounts.Account;
import android.accounts.AccountManager;
import com.owncloud.android.lib.common.operations.RemoteOperation;
import com.owncloud.android.lib.common.operations.RemoteOperationResult;
import com.owncloud.android.lib.common.operations.RemoteOperationResult.ResultCode;
+import com.owncloud.android.lib.common.utils.Log_OC;
import com.owncloud.android.lib.resources.files.ChunkedUploadRemoteFileOperation;
import com.owncloud.android.lib.resources.files.ExistenceCheckRemoteOperation;
import com.owncloud.android.lib.resources.files.UploadRemoteFileOperation;
import com.owncloud.android.utils.FileStorageUtils;
-import com.owncloud.android.utils.Log_OC;
import android.accounts.Account;
import android.content.Context;
import java.util.HashMap;
import com.owncloud.android.R;
+import com.owncloud.android.datamodel.ThumbnailsCacheManager;
import com.owncloud.android.db.ProviderMeta;
import com.owncloud.android.db.ProviderMeta.ProviderTableMeta;
+import com.owncloud.android.lib.common.utils.Log_OC;
import com.owncloud.android.lib.resources.shares.ShareType;
-import com.owncloud.android.utils.Log_OC;
-
-
import android.content.ContentProvider;
import android.content.ContentProviderOperation;
ProviderTableMeta.FILE_PERMISSIONS);
mFileProjectionMap.put(ProviderTableMeta.FILE_REMOTE_ID,
ProviderTableMeta.FILE_REMOTE_ID);
+ mFileProjectionMap.put(ProviderTableMeta.FILE_UPDATE_THUMBNAIL,
+ ProviderTableMeta.FILE_UPDATE_THUMBNAIL);
}
private static final int SINGLE_FILE = 1;
int count = 0;
switch (mUriMatcher.match(uri)) {
case SINGLE_FILE:
- /*Cursor c = query(db, uri, null, where, whereArgs, null);
- String remotePath = "(unexisting)";
+ Cursor c = query(db, uri, null, where, whereArgs, null);
+ String remoteId = "";
if (c != null && c.moveToFirst()) {
- remotePath = c.getString(c.getColumnIndex(ProviderTableMeta.FILE_PATH));
+ remoteId = c.getString(c.getColumnIndex(ProviderTableMeta.FILE_REMOTE_ID));
+ //ThumbnailsCacheManager.removeFileFromCache(remoteId);
}
- Log_OC.d(TAG, "Removing FILE " + remotePath);
- */
+ Log_OC.d(TAG, "Removing FILE " + remoteId);
+
count = db.delete(ProviderTableMeta.FILE_TABLE_NAME,
ProviderTableMeta._ID
+ "="
Cursor children = query(uri, null, null, null, null);
if (children != null && children.moveToFirst()) {
long childId;
- boolean isDir;
+ boolean isDir;
//String remotePath;
while (!children.isAfterLast()) {
childId = children.getLong(children.getColumnIndex(ProviderTableMeta._ID));
- isDir = "DIR".equals(children.getString(children.getColumnIndex(ProviderTableMeta.FILE_CONTENT_TYPE)));
+ isDir = "DIR".equals(children.getString(
+ children.getColumnIndex(ProviderTableMeta.FILE_CONTENT_TYPE)
+ ));
//remotePath = children.getString(children.getColumnIndex(ProviderTableMeta.FILE_PATH));
if (isDir) {
- count += delete(db, ContentUris.withAppendedId(ProviderTableMeta.CONTENT_URI_DIR, childId), null, null);
+ count += delete(
+ db,
+ ContentUris.withAppendedId(ProviderTableMeta.CONTENT_URI_DIR, childId),
+ null,
+ null
+ );
} else {
- count += delete(db, ContentUris.withAppendedId(ProviderTableMeta.CONTENT_URI_FILE, childId), null, null);
+ count += delete(
+ db,
+ ContentUris.withAppendedId(ProviderTableMeta.CONTENT_URI_FILE, childId),
+ null,
+ null
+ );
}
children.moveToNext();
}
}
return count;
}
-
@Override
public String getType(Uri uri) {
@Override
public Uri insert(Uri uri, ContentValues values) {
- //Log_OC.d(TAG, "Inserting " + values.getAsString(ProviderTableMeta.FILE_PATH) + " at provider " + this);
Uri newUri = null;
SQLiteDatabase db = mDbHelper.getWritableDatabase();
db.beginTransaction();
case SINGLE_FILE:
String remotePath = values.getAsString(ProviderTableMeta.FILE_PATH);
String accountName = values.getAsString(ProviderTableMeta.FILE_ACCOUNT_OWNER);
- String[] projection = new String[] {ProviderTableMeta._ID, ProviderTableMeta.FILE_PATH, ProviderTableMeta.FILE_ACCOUNT_OWNER };
- String where = ProviderTableMeta.FILE_PATH + "=? AND " + ProviderTableMeta.FILE_ACCOUNT_OWNER + "=?";
+ String[] projection = new String[] {
+ ProviderTableMeta._ID, ProviderTableMeta.FILE_PATH,
+ ProviderTableMeta.FILE_ACCOUNT_OWNER
+ };
+ String where = ProviderTableMeta.FILE_PATH + "=? AND " +
+ ProviderTableMeta.FILE_ACCOUNT_OWNER + "=?";
String[] whereArgs = new String[] {remotePath, accountName};
Cursor doubleCheck = query(db, uri, projection, where, whereArgs, null);
- if (doubleCheck == null || !doubleCheck.moveToFirst()) { // ugly patch; serious refactorization is needed to reduce work in FileDataStorageManager and bring it to FileContentProvider
+ // ugly patch; serious refactorization is needed to reduce work in
+ // FileDataStorageManager and bring it to FileContentProvider
+ if (doubleCheck == null || !doubleCheck.moveToFirst()) {
long rowId = db.insert(ProviderTableMeta.FILE_TABLE_NAME, null, values);
if (rowId > 0) {
- Uri insertedFileUri = ContentUris.withAppendedId(ProviderTableMeta.CONTENT_URI_FILE, rowId);
- //Log_OC.d(TAG, "Inserted " + values.getAsString(ProviderTableMeta.FILE_PATH) + " at provider " + this);
+ Uri insertedFileUri =
+ ContentUris.withAppendedId(ProviderTableMeta.CONTENT_URI_FILE, rowId);
return insertedFileUri;
} else {
- //Log_OC.d(TAG, "Error while inserting " + values.getAsString(ProviderTableMeta.FILE_PATH) + " at provider " + this);
throw new SQLException("ERROR " + uri);
}
} else {
// file is already inserted; race condition, let's avoid a duplicated entry
- Uri insertedFileUri = ContentUris.withAppendedId(ProviderTableMeta.CONTENT_URI_FILE, doubleCheck.getLong(doubleCheck.getColumnIndex(ProviderTableMeta._ID)));
+ Uri insertedFileUri = ContentUris.withAppendedId(
+ ProviderTableMeta.CONTENT_URI_FILE,
+ doubleCheck.getLong(doubleCheck.getColumnIndex(ProviderTableMeta._ID))
+ );
doubleCheck.close();
return insertedFileUri;
case SHARES:
String path = values.getAsString(ProviderTableMeta.OCSHARES_PATH);
String accountNameShare= values.getAsString(ProviderTableMeta.OCSHARES_ACCOUNT_OWNER);
- String[] projectionShare = new String[] {ProviderTableMeta._ID, ProviderTableMeta.OCSHARES_PATH, ProviderTableMeta.OCSHARES_ACCOUNT_OWNER };
- String whereShare = ProviderTableMeta.OCSHARES_PATH + "=? AND " + ProviderTableMeta.OCSHARES_ACCOUNT_OWNER + "=?";
+ String[] projectionShare = new String[] {
+ ProviderTableMeta._ID, ProviderTableMeta.OCSHARES_PATH,
+ ProviderTableMeta.OCSHARES_ACCOUNT_OWNER
+ };
+ String whereShare = ProviderTableMeta.OCSHARES_PATH + "=? AND " +
+ ProviderTableMeta.OCSHARES_ACCOUNT_OWNER + "=?";
String[] whereArgsShare = new String[] {path, accountNameShare};
Uri insertedShareUri = null;
- Cursor doubleCheckShare = query(db, uri, projectionShare, whereShare, whereArgsShare, null);
- if (doubleCheckShare == null || !doubleCheckShare.moveToFirst()) { // ugly patch; serious refactorization is needed to reduce work in FileDataStorageManager and bring it to FileContentProvider
+ Cursor doubleCheckShare =
+ query(db, uri, projectionShare, whereShare, whereArgsShare, null);
+ // ugly patch; serious refactorization is needed to reduce work in
+ // FileDataStorageManager and bring it to FileContentProvider
+ if (doubleCheckShare == null || !doubleCheckShare.moveToFirst()) {
long rowId = db.insert(ProviderTableMeta.OCSHARES_TABLE_NAME, null, values);
if (rowId >0) {
- insertedShareUri = ContentUris.withAppendedId(ProviderTableMeta.CONTENT_URI_SHARE, rowId);
+ insertedShareUri =
+ ContentUris.withAppendedId(ProviderTableMeta.CONTENT_URI_SHARE, rowId);
} else {
throw new SQLException("ERROR " + uri);
}
} else {
// file is already inserted; race condition, let's avoid a duplicated entry
- insertedShareUri = ContentUris.withAppendedId(ProviderTableMeta.CONTENT_URI_SHARE, doubleCheckShare.getLong(doubleCheckShare.getColumnIndex(ProviderTableMeta._ID)));
+ insertedShareUri = ContentUris.withAppendedId(
+ ProviderTableMeta.CONTENT_URI_SHARE,
+ doubleCheckShare.getLong(
+ doubleCheckShare.getColumnIndex(ProviderTableMeta._ID)
+ )
+ );
doubleCheckShare.close();
}
updateFilesTableAccordingToShareInsertion(db, uri, values);
}
- private void updateFilesTableAccordingToShareInsertion(SQLiteDatabase db, Uri uri, ContentValues shareValues) {
+ private void updateFilesTableAccordingToShareInsertion(
+ SQLiteDatabase db, Uri uri, ContentValues shareValues
+ ) {
ContentValues fileValues = new ContentValues();
- fileValues.put(ProviderTableMeta.FILE_SHARE_BY_LINK,
- ShareType.PUBLIC_LINK.getValue() == shareValues.getAsInteger(ProviderTableMeta.OCSHARES_SHARE_TYPE)? 1 : 0);
- String whereShare = ProviderTableMeta.FILE_PATH + "=? AND " + ProviderTableMeta.FILE_ACCOUNT_OWNER + "=?";
+ fileValues.put(
+ ProviderTableMeta.FILE_SHARE_BY_LINK,
+ ShareType.PUBLIC_LINK.getValue() ==
+ shareValues.getAsInteger(ProviderTableMeta.OCSHARES_SHARE_TYPE)? 1 : 0
+ );
+ String whereShare = ProviderTableMeta.FILE_PATH + "=? AND " +
+ ProviderTableMeta.FILE_ACCOUNT_OWNER + "=?";
String[] whereArgsShare = new String[] {
shareValues.getAsString(ProviderTableMeta.OCSHARES_PATH),
shareValues.getAsString(ProviderTableMeta.OCSHARES_ACCOUNT_OWNER)
@Override
- public Cursor query(Uri uri, String[] projection, String selection, String[] selectionArgs, String sortOrder) {
+ public Cursor query(
+ Uri uri,
+ String[] projection,
+ String selection,
+ String[] selectionArgs,
+ String sortOrder
+ ) {
+
Cursor result = null;
SQLiteDatabase db = mDbHelper.getReadableDatabase();
db.beginTransaction();
return result;
}
- private Cursor query(SQLiteDatabase db, Uri uri, String[] projection, String selection, String[] selectionArgs, String sortOrder) {
+ private Cursor query(
+ SQLiteDatabase db,
+ Uri uri,
+ String[] projection,
+ String selection,
+ String[] selectionArgs,
+ String sortOrder
+ ) {
+
SQLiteQueryBuilder sqlQuery = new SQLiteQueryBuilder();
sqlQuery.setTables(ProviderTableMeta.FILE_TABLE_NAME);
@Override
public int update(Uri uri, ContentValues values, String selection, String[] selectionArgs) {
- //Log_OC.d(TAG, "Updating " + values.getAsString(ProviderTableMeta.FILE_PATH) + " at provider " + this);
int count = 0;
SQLiteDatabase db = mDbHelper.getWritableDatabase();
db.beginTransaction();
- private int update(SQLiteDatabase db, Uri uri, ContentValues values, String selection, String[] selectionArgs) {
+ private int update(
+ SQLiteDatabase db,
+ Uri uri,
+ ContentValues values,
+ String selection,
+ String[] selectionArgs
+ ) {
switch (mUriMatcher.match(uri)) {
case DIRECTORY:
return 0; //updateFolderSize(db, selectionArgs[0]);
case SHARES:
- return db.update(ProviderTableMeta.OCSHARES_TABLE_NAME, values, selection, selectionArgs);
+ return db.update(
+ ProviderTableMeta.OCSHARES_TABLE_NAME, values, selection, selectionArgs
+ );
default:
- return db.update(ProviderTableMeta.FILE_TABLE_NAME, values, selection, selectionArgs);
+ return db.update(
+ ProviderTableMeta.FILE_TABLE_NAME, values, selection, selectionArgs
+ );
}
}
*/
@Override
- public ContentProviderResult[] applyBatch (ArrayList<ContentProviderOperation> operations) throws OperationApplicationException {
- Log_OC.d("FileContentProvider", "applying batch in provider " + this + " (temporary: " + isTemporary() + ")" );
+ public ContentProviderResult[] applyBatch (ArrayList<ContentProviderOperation> operations)
+ throws OperationApplicationException {
+ Log_OC.d("FileContentProvider", "applying batch in provider " + this +
+ " (temporary: " + isTemporary() + ")" );
ContentProviderResult[] results = new ContentProviderResult[operations.size()];
int i=0;
+ ProviderTableMeta.FILE_SHARE_BY_LINK + " INTEGER, "
+ ProviderTableMeta.FILE_PUBLIC_LINK + " TEXT, "
+ ProviderTableMeta.FILE_PERMISSIONS + " TEXT null,"
- + ProviderTableMeta.FILE_REMOTE_ID + " TEXT null);"
+ + ProviderTableMeta.FILE_REMOTE_ID + " TEXT null,"
+ + ProviderTableMeta.FILE_UPDATE_THUMBNAIL + " INTEGER);" //boolean
);
// Create table ocshares
db.beginTransaction();
try {
db.execSQL("ALTER TABLE " + ProviderTableMeta.FILE_TABLE_NAME +
- " ADD COLUMN " + ProviderTableMeta.FILE_LAST_SYNC_DATE_FOR_DATA + " INTEGER " +
- " DEFAULT 0");
+ " ADD COLUMN " + ProviderTableMeta.FILE_LAST_SYNC_DATE_FOR_DATA +
+ " INTEGER " + " DEFAULT 0");
// assume there are not local changes pending to upload
db.execSQL("UPDATE " + ProviderTableMeta.FILE_TABLE_NAME +
- " SET " + ProviderTableMeta.FILE_LAST_SYNC_DATE_FOR_DATA + " = " + System.currentTimeMillis() +
+ " SET " + ProviderTableMeta.FILE_LAST_SYNC_DATE_FOR_DATA + " = "
+ + System.currentTimeMillis() +
" WHERE " + ProviderTableMeta.FILE_STORAGE_PATH + " IS NOT NULL");
upgraded = true;
db.beginTransaction();
try {
db .execSQL("ALTER TABLE " + ProviderTableMeta.FILE_TABLE_NAME +
- " ADD COLUMN " + ProviderTableMeta.FILE_MODIFIED_AT_LAST_SYNC_FOR_DATA + " INTEGER " +
- " DEFAULT 0");
+ " ADD COLUMN " + ProviderTableMeta.FILE_MODIFIED_AT_LAST_SYNC_FOR_DATA +
+ " INTEGER " + " DEFAULT 0");
db.execSQL("UPDATE " + ProviderTableMeta.FILE_TABLE_NAME +
- " SET " + ProviderTableMeta.FILE_MODIFIED_AT_LAST_SYNC_FOR_DATA + " = " + ProviderTableMeta.FILE_MODIFIED +
+ " SET " + ProviderTableMeta.FILE_MODIFIED_AT_LAST_SYNC_FOR_DATA + " = " +
+ ProviderTableMeta.FILE_MODIFIED +
" WHERE " + ProviderTableMeta.FILE_STORAGE_PATH + " IS NOT NULL");
upgraded = true;
}
}
if (!upgraded)
- Log_OC.i("SQL", "OUT of the ADD in onUpgrade; oldVersion == " + oldVersion + ", newVersion == " + newVersion);
+ Log_OC.i("SQL", "OUT of the ADD in onUpgrade; oldVersion == " + oldVersion +
+ ", newVersion == " + newVersion);
if (oldVersion < 5 && newVersion >= 5) {
Log_OC.i("SQL", "Entering in the #4 ADD in onUpgrade");
}
}
if (!upgraded)
- Log_OC.i("SQL", "OUT of the ADD in onUpgrade; oldVersion == " + oldVersion + ", newVersion == " + newVersion);
+ Log_OC.i("SQL", "OUT of the ADD in onUpgrade; oldVersion == " + oldVersion +
+ ", newVersion == " + newVersion);
if (oldVersion < 6 && newVersion >= 6) {
Log_OC.i("SQL", "Entering in the #5 ADD in onUpgrade");
}
}
if (!upgraded)
- Log_OC.i("SQL", "OUT of the ADD in onUpgrade; oldVersion == " + oldVersion + ", newVersion == " + newVersion);
+ Log_OC.i("SQL", "OUT of the ADD in onUpgrade; oldVersion == " + oldVersion +
+ ", newVersion == " + newVersion);
if (oldVersion < 7 && newVersion >= 7) {
Log_OC.i("SQL", "Entering in the #7 ADD in onUpgrade");
}
}
if (!upgraded)
- Log_OC.i("SQL", "OUT of the ADD in onUpgrade; oldVersion == " + oldVersion + ", newVersion == " + newVersion);
+ Log_OC.i("SQL", "OUT of the ADD in onUpgrade; oldVersion == " + oldVersion +
+ ", newVersion == " + newVersion);
+
+ if (oldVersion < 8 && newVersion >= 8) {
+ Log_OC.i("SQL", "Entering in the #8 ADD in onUpgrade");
+ db.beginTransaction();
+ try {
+ db .execSQL("ALTER TABLE " + ProviderTableMeta.FILE_TABLE_NAME +
+ " ADD COLUMN " + ProviderTableMeta.FILE_UPDATE_THUMBNAIL + " INTEGER " +
+ " DEFAULT 0");
+
+ upgraded = true;
+ db.setTransactionSuccessful();
+ } finally {
+ db.endTransaction();
+ }
+ }
+ if (!upgraded)
+ Log_OC.i("SQL", "OUT of the ADD in onUpgrade; oldVersion == " + oldVersion +
+ ", newVersion == " + newVersion);
}
}
import com.owncloud.android.lib.common.operations.OnRemoteOperationListener;
import com.owncloud.android.lib.common.operations.RemoteOperation;
import com.owncloud.android.lib.common.operations.RemoteOperationResult;
+import com.owncloud.android.lib.common.utils.Log_OC;
import com.owncloud.android.lib.resources.files.ExistenceCheckRemoteOperation;
import com.owncloud.android.lib.resources.shares.ShareType;
import com.owncloud.android.lib.resources.users.GetRemoteUserNameOperation;
import com.owncloud.android.operations.RenameFileOperation;
import com.owncloud.android.operations.SynchronizeFileOperation;
import com.owncloud.android.operations.UnshareLinkOperation;
-import com.owncloud.android.utils.Log_OC;
import android.accounts.Account;
import android.accounts.AccountsException;
import com.owncloud.android.datamodel.OCFile;
import com.owncloud.android.db.ProviderMeta.ProviderTableMeta;
import com.owncloud.android.files.services.FileDownloader;
+import com.owncloud.android.lib.common.utils.Log_OC;
import com.owncloud.android.operations.SynchronizeFileOperation;
import com.owncloud.android.utils.FileStorageUtils;
-import com.owncloud.android.utils.Log_OC;
/**
import com.owncloud.android.datamodel.OCFile;
import com.owncloud.android.lib.common.operations.RemoteOperationResult;
import com.owncloud.android.lib.common.operations.RemoteOperationResult.ResultCode;
+import com.owncloud.android.lib.common.utils.Log_OC;
import com.owncloud.android.operations.SynchronizeFileOperation;
import com.owncloud.android.ui.activity.ConflictsResolveActivity;
-import com.owncloud.android.utils.Log_OC;
/**
* Observer watching a folder to request the synchronization of kept-in-sync files
import com.owncloud.android.operations.SynchronizeFolderOperation;
import com.owncloud.android.operations.UpdateOCVersionOperation;
import com.owncloud.android.lib.common.operations.RemoteOperationResult.ResultCode;
+import com.owncloud.android.lib.common.utils.Log_OC;
import com.owncloud.android.ui.activity.ErrorsWhileCopyingHandlerActivity;
-import com.owncloud.android.utils.Log_OC;
import android.accounts.Account;
import android.accounts.AccountsException;
mCurrentSyncTime,
true,
mIsShareSupported,
+ true,
getStorageManager(),
getAccount(),
getContext()
import com.actionbarsherlock.app.ActionBar;
import com.owncloud.android.datamodel.OCFile;
import com.owncloud.android.files.services.FileUploader;
+import com.owncloud.android.lib.common.utils.Log_OC;
import com.owncloud.android.ui.dialog.ConflictsResolveDialog;
import com.owncloud.android.ui.dialog.ConflictsResolveDialog.Decision;
import com.owncloud.android.ui.dialog.ConflictsResolveDialog.OnConflictDecisionMadeListener;
import com.owncloud.android.utils.DisplayUtils;
-import com.owncloud.android.utils.Log_OC;
import android.content.Intent;
import android.os.Bundle;
import com.owncloud.android.R;
import com.owncloud.android.datamodel.FileDataStorageManager;
import com.owncloud.android.datamodel.OCFile;
+import com.owncloud.android.lib.common.utils.Log_OC;
import com.owncloud.android.ui.dialog.IndeterminateProgressDialog;
import com.owncloud.android.utils.FileStorageUtils;
-import com.owncloud.android.utils.Log_OC;
import com.owncloud.android.lib.common.operations.RemoteOperation;
import com.owncloud.android.lib.common.operations.RemoteOperationResult;
import com.owncloud.android.lib.common.operations.RemoteOperationResult.ResultCode;
+import com.owncloud.android.lib.common.utils.Log_OC;
import com.owncloud.android.operations.CreateShareOperation;
import com.owncloud.android.operations.UnshareLinkOperation;
import com.owncloud.android.services.OperationsService.OperationsServiceBinder;
import com.owncloud.android.ui.dialog.LoadingDialog;
import com.owncloud.android.utils.ErrorMessageAdapter;
-import com.owncloud.android.utils.Log_OC;
/**
import java.io.File;
import java.io.IOException;
-import org.apache.commons.httpclient.methods.PostMethod;
-
import android.accounts.Account;
import android.accounts.AccountManager;
import android.accounts.AuthenticatorException;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentTransaction;
-import android.support.v4.widget.SwipeRefreshLayout;
import android.util.Log;
import android.view.View;
import android.view.ViewGroup;
import com.actionbarsherlock.view.MenuInflater;
import com.actionbarsherlock.view.MenuItem;
import com.actionbarsherlock.view.Window;
+import com.owncloud.android.BuildConfig;
import com.owncloud.android.MainApp;
import com.owncloud.android.R;
import com.owncloud.android.datamodel.OCFile;
import com.owncloud.android.lib.common.operations.RemoteOperation;
import com.owncloud.android.lib.common.operations.RemoteOperationResult;
import com.owncloud.android.lib.common.operations.RemoteOperationResult.ResultCode;
+import com.owncloud.android.lib.common.utils.Log_OC;
import com.owncloud.android.operations.CreateFolderOperation;
import com.owncloud.android.operations.CreateShareOperation;
import com.owncloud.android.operations.MoveFileOperation;
import com.owncloud.android.ui.preview.PreviewVideoActivity;
import com.owncloud.android.utils.DisplayUtils;
import com.owncloud.android.utils.ErrorMessageAdapter;
-import com.owncloud.android.utils.Log_OC;
/**
public class FileDisplayActivity extends HookActivity implements
FileFragment.ContainerActivity, OnNavigationListener,
-OnSslUntrustedCertListener, SwipeRefreshLayout.OnRefreshListener {
+OnSslUntrustedCertListener, OnEnforceableRefreshListener {
private ArrayAdapter<String> mDirectories;
Log_OC.e(TAG, "Initializing Fragments in onAccountChanged..");
initFragmentsWithFile();
if (file.isFolder()) {
- startSyncFolderOperation(file);
+ startSyncFolderOperation(file, false);
}
} else {
if (listOfFiles != null) {
listOfFiles.listDirectory(getCurrentDir());
} else {
- Log.e(TAG, "Still have a chance to lose the initializacion of list fragment >(");
+ Log_OC.e(TAG, "Still have a chance to lose the initializacion of list fragment >(");
}
/// Second fragment
}
} else {
- Log.wtf(TAG, "initFragments() called with invalid NULLs!");
+ Log_OC.wtf(TAG, "initFragments() called with invalid NULLs!");
if (getAccount() == null) {
- Log.wtf(TAG, "\t account is NULL");
+ Log_OC.wtf(TAG, "\t account is NULL");
}
if (getFile() == null) {
- Log.wtf(TAG, "\t file is NULL");
+ Log_OC.wtf(TAG, "\t file is NULL");
}
}
}
}
@Override
+ public boolean onPrepareOptionsMenu(Menu menu) {
+ if (BuildConfig.DEBUG) {
+ menu.findItem(R.id.action_logger).setVisible(true);
+ } else {
+ menu.findItem(R.id.action_logger).setVisible(false);
+ }
+ return super.onPrepareOptionsMenu(menu);
+ }
+
+ @Override
public boolean onCreateOptionsMenu(Menu menu) {
MenuInflater inflater = getSherlock().getMenuInflater();
inflater.inflate(R.menu.main_menu, menu);
startActivity(settingsIntent);
break;
}
+ case R.id.action_logger: {
+ Intent loggerIntent = new Intent(getApplicationContext(),LogHistoryActivity.class);
+ startActivity(loggerIntent);
+ break;
+ }
case android.R.id.home: {
FileFragment second = getSecondFragment();
OCFile currentDir = getCurrentDir();
}
ocFileListFragment.setMessageForEmptyList(getString(message));
} else {
- Log.e(TAG, "OCFileListFragment is null");
+ Log_OC.e(TAG, "OCFileListFragment is null");
}
}
OCFile root = getStorageManager().getFileByPath(OCFile.ROOT_PATH);
listOfFiles.listDirectory(root);
setFile(listOfFiles.getCurrentFile());
- startSyncFolderOperation(root);
+ startSyncFolderOperation(root, false);
}
cleanSecondFragment();
}
setNavigationListWithFolder(folder);
listOfFiles.listDirectory(folder);
setFile(listOfFiles.getCurrentFile());
- startSyncFolderOperation(folder);
+ startSyncFolderOperation(folder, false);
} else {
Log_OC.e(TAG, "Unexpected null when accessing list fragment");
}
cleanSecondFragment();
// Sync Folder
- startSyncFolderOperation(directory);
+ startSyncFolderOperation(directory, false);
}
@Override
public void onSavedCertificate() {
- startSyncFolderOperation(getCurrentDir());
+ startSyncFolderOperation(getCurrentDir(), false);
}
return null;
}
- public void startSyncFolderOperation(OCFile folder) {
+ public void startSyncFolderOperation(OCFile folder, boolean ignoreETag) {
long currentSyncTime = System.currentTimeMillis();
mSyncInProgress = true;
currentSyncTime,
false,
getFileOperationsHelper().isSharedSupported(),
+ ignoreETag,
getStorageManager(),
getAccount(),
getApplicationContext()
}
@Override
+ public void onRefresh(boolean ignoreETag) {
+ refreshList(ignoreETag);
+ }
+
+ @Override
public void onRefresh() {
+ refreshList(true);
+ }
+
+ private void refreshList(boolean ignoreETag) {
OCFileListFragment listOfFiles = getListOfFilesFragment();
if (listOfFiles != null) {
OCFile folder = listOfFiles.getCurrentFile();
if (folder != null) {
/*mFile = mContainerActivity.getStorageManager().getFileById(mFile.getFileId());
listDirectory(mFile);*/
- startSyncFolderOperation(folder);
+ startSyncFolderOperation(folder, ignoreETag);
}
}
}
-
}
package com.owncloud.android.ui.activity;
+import java.io.BufferedReader;
import java.io.File;
+import java.io.FileReader;
+import java.io.IOException;
+import java.lang.ref.WeakReference;
+import java.lang.reflect.Field;
import java.util.ArrayList;
import android.content.Intent;
+import android.net.Uri;
+import android.os.AsyncTask;
import android.os.Bundle;
-import android.preference.Preference;
-import android.preference.Preference.OnPreferenceChangeListener;
+import android.support.v4.app.Fragment;
+import android.support.v4.app.FragmentManager;
+import android.support.v4.app.FragmentTransaction;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
-import android.widget.ListView;
+import android.widget.TextView;
import com.actionbarsherlock.app.ActionBar;
-import com.actionbarsherlock.app.SherlockPreferenceActivity;
+import com.actionbarsherlock.app.SherlockFragmentActivity;
import com.actionbarsherlock.view.MenuItem;
import com.owncloud.android.R;
-import com.owncloud.android.ui.adapter.LogListAdapter;
+import com.owncloud.android.lib.common.utils.Log_OC;
+import com.owncloud.android.ui.dialog.LoadingDialog;
import com.owncloud.android.utils.DisplayUtils;
import com.owncloud.android.utils.FileStorageUtils;
+public class LogHistoryActivity extends SherlockFragmentActivity {
+
+ private static final String MAIL_ATTACHMENT_TYPE = "text/plain";
+
+ private static final String TAG = LogHistoryActivity.class.getSimpleName();
+
+ private static final String DIALOG_WAIT_TAG = "DIALOG_WAIT";
+
+ private String mLogPath = FileStorageUtils.getLogPath();
+ private File logDIR = null;
-public class LogHistoryActivity extends SherlockPreferenceActivity implements OnPreferenceChangeListener {
- String logpath = FileStorageUtils.getLogPath();
- File logDIR = null;
-
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
-
+
setContentView(R.layout.log_send_file);
- setTitle("Log History");
+ setTitle(getText(R.string.actionbar_logger));
ActionBar actionBar = getSherlock().getActionBar();
actionBar.setIcon(DisplayUtils.getSeasonalIconId());
actionBar.setDisplayHomeAsUpEnabled(true);
- ListView listView = (ListView) findViewById(android.R.id.list);
Button deleteHistoryButton = (Button) findViewById(R.id.deleteLogHistoryButton);
-
+ Button sendHistoryButton = (Button) findViewById(R.id.sendLogHistoryButton);
+
deleteHistoryButton.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
- File dir = new File(logpath);
- if (dir != null) {
- File[] files = dir.listFiles();
- if(files!=null) {
- for(File f: files) {
- f.delete();
- }
- }
- dir.delete();
- }
- Intent intent = new Intent(getBaseContext(), Preferences.class);
- intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
- startActivity(intent);
+
+ Log_OC.deleteHistoryLogging();
+ finish();
}
-
});
-
-
- if(logpath != null){
- logDIR = new File(logpath);
- }
-
- if(logDIR != null && logDIR.isDirectory()) {
- File[] files = logDIR.listFiles();
-
- if (files != null && files.length != 0) {
- ArrayList<String> logfiles_name = new ArrayList<String>();
- for (File file : files) {
- logfiles_name.add(file.getName());
- }
- String[] logFiles2Array = logfiles_name.toArray(new String[logfiles_name.size()]);
- LogListAdapter listadapter = new LogListAdapter(this,logFiles2Array);
- listView.setAdapter(listadapter);
+
+ sendHistoryButton.setOnClickListener(new OnClickListener() {
+
+ @Override
+ public void onClick(View v) {
+ sendMail();
}
+ });
+
+ if (mLogPath != null) {
+ logDIR = new File(mLogPath);
+ }
+
+ if (logDIR != null && logDIR.isDirectory()) {
+ // Show a dialog while log data is being loaded
+ showLoadingDialog();
+
+ TextView logTV = (TextView) findViewById(R.id.logTV);
+
+ // Start a new thread that will load all the log data
+ LoadingLogTask task = new LoadingLogTask(logTV);
+ task.execute();
+
}
}
-
@Override
public boolean onMenuItemSelected(int featureId, MenuItem item) {
super.onMenuItemSelected(featureId, item);
- Intent intent;
-
switch (item.getItemId()) {
-
case android.R.id.home:
- intent = new Intent(getBaseContext(), Preferences.class);
- intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
- startActivity(intent);
+ finish();
break;
default:
return false;
}
return true;
}
- @Override
- public boolean onPreferenceChange(Preference arg0, Object arg1) {
- return false;
+
+
+ /**
+ * Start activity for sending email with logs attached
+ */
+ private void sendMail() {
+
+ String emailAddress;
+ try {
+ Class<?> stringClass = R.string.class;
+ Field mailLoggerField = stringClass.getField("mail_logger");
+ int emailAddressId = (Integer)mailLoggerField.get(null);
+ emailAddress = getString(emailAddressId);
+
+ } catch (Exception e) {
+ emailAddress = "";
+ }
+
+ ArrayList<Uri> uris = new ArrayList<Uri>();
+
+ // Convert from paths to Android friendly Parcelable Uri's
+ for (String file : Log_OC.getLogFileNames())
+ {
+ if (new File(mLogPath + File.separator, file).exists()) {
+ Uri u = Uri.parse("file://" + mLogPath + File.separator + file);
+ uris.add(u);
+ }
+ }
+
+ Intent intent = new Intent(Intent.ACTION_SEND_MULTIPLE);
+
+ // Explicitly only use Gmail to send
+ intent.setClassName("com.google.android.gm","com.google.android.gm.ComposeActivityGmail");
+ intent.putExtra(Intent.EXTRA_EMAIL, new String[]{ emailAddress });
+ intent.putExtra(Intent.EXTRA_SUBJECT, getText(R.string.log_mail_subject));
+ intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
+ intent.setType(MAIL_ATTACHMENT_TYPE);
+ intent.putParcelableArrayListExtra(Intent.EXTRA_STREAM, uris);
+
+ if (intent.resolveActivity(getPackageManager()) != null) {
+ startActivity(intent);
+ }
+ }
+
+ /**
+ *
+ * Class for loading the log data async
+ *
+ */
+ private class LoadingLogTask extends AsyncTask<String, Void, String> {
+ private final WeakReference<TextView> textViewReference;
+
+ public LoadingLogTask(TextView logTV){
+ // Use of a WeakReference to ensure the TextView can be garbage collected
+ textViewReference = new WeakReference<TextView>(logTV);
+ }
+
+ protected String doInBackground(String... args) {
+ return readLogFile();
+ }
+
+ protected void onPostExecute(String result) {
+ if (textViewReference != null && result != null) {
+ final TextView logTV = textViewReference.get();
+ if (logTV != null) {
+ logTV.setText(result);
+ dismissLoadingDialog();
+ }
+ }
+ }
+
+ /**
+ * Read and show log file info
+ */
+ private String readLogFile() {
+
+ String[] logFileName = Log_OC.getLogFileNames();
+
+ //Read text from files
+ StringBuilder text = new StringBuilder();
+
+ BufferedReader br = null;
+ try {
+ String line;
+
+ for (int i = logFileName.length-1; i >= 0; i--) {
+ File file = new File(mLogPath,logFileName[i]);
+ if (file.exists()) {
+ // Check if FileReader is ready
+ if (new FileReader(file).ready()) {
+ br = new BufferedReader(new FileReader(file));
+ while ((line = br.readLine()) != null) {
+ // Append the log info
+ text.append(line);
+ text.append('\n');
+ }
+ }
+ }
+ }
+ }
+ catch (IOException e) {
+ Log_OC.d(TAG, e.getMessage().toString());
+
+ } finally {
+ if (br != null) {
+ try {
+ br.close();
+ } catch (IOException e) {
+ // ignore
+ }
+ }
+ }
+
+ return text.toString();
+ }
+ }
+
+ /**
+ * Show loading dialog
+ */
+ public void showLoadingDialog() {
+ // Construct dialog
+ LoadingDialog loading = new LoadingDialog(
+ getResources().getString(R.string.log_progress_dialog_text)
+ );
+ FragmentManager fm = getSupportFragmentManager();
+ FragmentTransaction ft = fm.beginTransaction();
+ loading.show(ft, DIALOG_WAIT_TAG);
+ }
+
+ /**
+ * Dismiss loading dialog
+ */
+ public void dismissLoadingDialog(){
+ Fragment frag = getSupportFragmentManager().findFragmentByTag(DIALOG_WAIT_TAG);
+ if (frag != null) {
+ LoadingDialog loading = (LoadingDialog) frag;
+ loading.dismiss();
+ }
}
}
\ No newline at end of file
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentTransaction;
-import android.support.v4.widget.SwipeRefreshLayout;
import android.util.Log;
import android.view.View;
import android.view.View.OnClickListener;
import com.owncloud.android.ui.fragment.OCFileListFragment;
import com.owncloud.android.utils.DisplayUtils;
import com.owncloud.android.utils.ErrorMessageAdapter;
-import com.owncloud.android.utils.Log_OC;
+import com.owncloud.android.lib.common.utils.Log_OC;
public class MoveActivity extends HookActivity implements FileFragment.ContainerActivity,
- OnClickListener, SwipeRefreshLayout.OnRefreshListener {
+ OnClickListener, OnEnforceableRefreshListener {
public static final String EXTRA_CURRENT_FOLDER = UploadFilesActivity.class.getCanonicalName() + ".EXTRA_CURRENT_FOLDER";
public static final String EXTRA_TARGET_FILE = UploadFilesActivity.class.getCanonicalName() + "EXTRA_TARGET_FILE";
OCFileListFragment listOfFolders = getListOfFilesFragment();
listOfFolders.listDirectory(folder);
- startSyncFolderOperation(folder);
+ startSyncFolderOperation(folder, false);
}
updateNavigationElementsInActionBar();
setFile(directory);
updateNavigationElementsInActionBar();
// Sync Folder
- startSyncFolderOperation(directory);
+ startSyncFolderOperation(directory, false);
}
- public void startSyncFolderOperation(OCFile folder) {
+ public void startSyncFolderOperation(OCFile folder, boolean ignoreETag) {
long currentSyncTime = System.currentTimeMillis();
mSyncInProgress = true;
currentSyncTime,
false,
getFileOperationsHelper().isSharedSupported(),
+ ignoreETag,
getStorageManager(),
getAccount(),
getApplicationContext()
listOfFiles.listDirectory(root);
setFile(listOfFiles.getCurrentFile());
updateNavigationElementsInActionBar();
- startSyncFolderOperation(root);
+ startSyncFolderOperation(root, false);
}
}
}
-
@Override
public void onRefresh() {
+ refreshList(true);
+ }
+
+ @Override
+ public void onRefresh(boolean enforced) {
+ refreshList(enforced);
+ }
+
+ private void refreshList(boolean ignoreETag) {
OCFileListFragment listOfFiles = getListOfFilesFragment();
if (listOfFiles != null) {
OCFile folder = listOfFiles.getCurrentFile();
if (folder != null) {
- startSyncFolderOperation(folder);
+ startSyncFolderOperation(folder, ignoreETag);
}
}
}
-
}
--- /dev/null
+package com.owncloud.android.ui.activity;
+
+import android.support.v4.widget.SwipeRefreshLayout;
+
+ public interface OnEnforceableRefreshListener extends SwipeRefreshLayout.OnRefreshListener {
+
+ public void onRefresh(boolean enforced);
+
+ }
+
import com.owncloud.android.authentication.AccountUtils;
import com.owncloud.android.authentication.AuthenticatorActivity;
import com.owncloud.android.db.DbHandler;
+import com.owncloud.android.lib.common.utils.Log_OC;
import com.owncloud.android.ui.LongClickableCheckBoxPreference;
import com.owncloud.android.utils.DisplayUtils;
-import com.owncloud.android.utils.Log_OC;
/**
private DbHandler mDbHandler;
private CheckBoxPreference pCode;
- //private CheckBoxPreference pLogging;
- //private Preference pLoggingHistory;
private Preference pAboutApp;
private PreferenceCategory mAccountsPrefCategory = null;
private final Handler mHandler = new Handler();
private String mAccountName;
private boolean mShowContextMenu = false;
+ private String mUploadPath;
@SuppressWarnings("deprecation")
actionBar.setIcon(DisplayUtils.getSeasonalIconId());
actionBar.setDisplayHomeAsUpEnabled(true);
actionBar.setTitle(R.string.actionbar_settings);
-
+
+ loadInstantUploadPath();
+
// Load the accounts category for adding the list of accounts
mAccountsPrefCategory = (PreferenceCategory) findPreference("accounts_category");
preferenceCategory.removePreference(pImprint);
}
}
+
+ Preference pInstantUploadPathApp = (Preference) findPreference("instant_upload_path");
+
+ pInstantUploadPathApp.setOnPreferenceChangeListener(new OnPreferenceChangeListener() {
+ @Override
+ public boolean onPreferenceChange(Preference preference, Object newValue) {
+ mUploadPath = updateInstantUploadPath(newValue.toString());
+ return true;
+ }
+ });
/* About App */
pAboutApp = (Preference) findPreference("about_app");
Log_OC.e(TAG, "Error while showing about dialog", e);
}
}
-
- /* DISABLED FOR RELEASE UNTIL FIXED
- pLogging = (CheckBoxPreference) findPreference("log_to_file");
- if (pLogging != null) {
- pLogging.setOnPreferenceChangeListener(new OnPreferenceChangeListener() {
- @Override
- public boolean onPreferenceChange(Preference preference, Object newValue) {
-
- String logpath = Environment.getExternalStorageDirectory()+File.separator+"owncloud"+File.separator+"log";
-
- if(!pLogging.isChecked()) {
- Log_OC.d("Debug", "start logging");
- Log_OC.v("PATH", logpath);
- Log_OC.startLogging(logpath);
- }
- else {
- Log_OC.d("Debug", "stop logging");
- Log_OC.stopLogging();
- }
- return true;
- }
- });
- }
-
- pLoggingHistory = (Preference) findPreference("log_history");
- if (pLoggingHistory != null) {
- pLoggingHistory.setOnPreferenceClickListener(new OnPreferenceClickListener() {
-
- @Override
- public boolean onPreferenceClick(Preference preference) {
- Intent intent = new Intent(getApplicationContext(),LogHistoryActivity.class);
- startActivity(intent);
- return true;
- }
- });
- }
- */
-
+ }
+
+ @Override
+ protected void onPause() {
+ saveInstantUploadPathOnPreferences();
+ super.onPause();
}
@Override
}
+ /**
+ * Update the upload path checking that it is a correct path
+ * @param uploadPath: path write by user
+ * @return String: uploadPath
+ */
+ private String updateInstantUploadPath(String uploadPath) {
+ String slashString = "/";
+
+ // If slashes are duplicated, replace them for only one slash
+ uploadPath = uploadPath.replaceAll("/+", slashString);
+
+ // Remove last slash from path
+ if (uploadPath.length() > 0 && uploadPath.charAt(uploadPath.length()-1) == slashString.charAt(0)) {
+ uploadPath = uploadPath.substring(0, uploadPath.length()-1);
+ }
+
+ if (uploadPath.isEmpty()) { // Set default instant upload path
+ uploadPath = getString(R.string.instant_upload_path);
+ }else {
+ if (!uploadPath.startsWith(slashString)) { // Add initial slash on path if necessary
+ uploadPath = slashString.concat(uploadPath);
+ }
+ }
+ return uploadPath;
+ }
+
+ /**
+ * Load upload path set on preferences
+ */
+ private void loadInstantUploadPath() {
+ SharedPreferences appPrefs = PreferenceManager.getDefaultSharedPreferences(getApplicationContext());
+ mUploadPath = appPrefs.getString("instant_upload_path", getString(R.string.instant_upload_path));
+ }
+
+ /**
+ * Save the "Instant Upload Path" on preferences
+ */
+ private void saveInstantUploadPathOnPreferences() {
+ SharedPreferences appPrefs = PreferenceManager.getDefaultSharedPreferences(getApplicationContext());
+ SharedPreferences.Editor editor = appPrefs.edit();
+ editor.putString("instant_upload_path", mUploadPath);
+ editor.commit();
+ }
}
import com.actionbarsherlock.app.ActionBar.OnNavigationListener;
import com.actionbarsherlock.view.MenuItem;
import com.owncloud.android.R;
+import com.owncloud.android.lib.common.utils.Log_OC;
import com.owncloud.android.ui.dialog.ConfirmationDialogFragment;
import com.owncloud.android.ui.dialog.IndeterminateProgressDialog;
import com.owncloud.android.ui.dialog.ConfirmationDialogFragment.ConfirmationDialogFragmentListener;
import com.owncloud.android.ui.fragment.LocalFileListFragment;
import com.owncloud.android.utils.DisplayUtils;
import com.owncloud.android.utils.FileStorageUtils;
-import com.owncloud.android.utils.Log_OC;
/**
import com.owncloud.android.datamodel.FileDataStorageManager;
import com.owncloud.android.datamodel.OCFile;
import com.owncloud.android.files.services.FileUploader;
-import com.owncloud.android.utils.Log_OC;
+import com.owncloud.android.lib.common.utils.Log_OC;
import android.accounts.Account;
import android.accounts.AccountManager;
+/* ownCloud Android client application
+ * Copyright (C) 2012-2014 ownCloud Inc.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2,
+ * as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
package com.owncloud.android.ui.adapter;
import java.io.BufferedInputStream;
import java.io.InputStream;
import java.io.OutputStream;
-import android.content.Context;
import android.graphics.Bitmap;
import android.graphics.Bitmap.CompressFormat;
import android.graphics.BitmapFactory;
-import android.util.Log;
import com.jakewharton.disklrucache.DiskLruCache;
import com.owncloud.android.BuildConfig;
-import com.owncloud.android.utils.Log_OC;
+import com.owncloud.android.lib.common.utils.Log_OC;
public class DiskLruImageCache {
private static final int CACHE_VERSION = 1;
private static final int VALUE_COUNT = 1;
private static final int IO_BUFFER_SIZE = 8 * 1024;
- //private static final String TAG = "DiskLruImageCache";
-
- public DiskLruImageCache( Context context,String uniqueName, int diskCacheSize,
- CompressFormat compressFormat, int quality ) {
- try {
- final File diskCacheDir = getDiskCacheDir(context, uniqueName );
- mDiskCache = DiskLruCache.open(
- diskCacheDir, CACHE_VERSION, VALUE_COUNT, diskCacheSize
- );
- mCompressFormat = compressFormat;
- mCompressQuality = quality;
- } catch (IOException e) {
- e.printStackTrace();
- }
+
+ private static final String TAG = DiskLruImageCache.class.getSimpleName();
+
+ //public DiskLruImageCache( Context context,String uniqueName, int diskCacheSize,
+ public DiskLruImageCache(
+ File diskCacheDir, int diskCacheSize, CompressFormat compressFormat, int quality
+ ) throws IOException {
+
+ mDiskCache = DiskLruCache.open(
+ diskCacheDir, CACHE_VERSION, VALUE_COUNT, diskCacheSize
+ );
+ mCompressFormat = compressFormat;
+ mCompressQuality = quality;
}
private boolean writeBitmapToFile( Bitmap bitmap, DiskLruCache.Editor editor )
}
}
- private File getDiskCacheDir(Context context, String uniqueName) {
-
- // Check if media is mounted or storage is built-in, if so, try and use external cache dir
- // otherwise use internal cache dir
- final String cachePath = context.getExternalCacheDir().getPath();
-
- Log_OC.d("DiskCache", "create dir: " + cachePath + File.separator + uniqueName);
-
- return new File(cachePath + File.separator + uniqueName);
- }
-
public void put( String key, Bitmap data ) {
DiskLruCache.Editor editor = null;
+ String validKey = convertToValidKey(key);
try {
- editor = mDiskCache.edit( key );
+ editor = mDiskCache.edit( validKey );
if ( editor == null ) {
return;
}
mDiskCache.flush();
editor.commit();
if ( BuildConfig.DEBUG ) {
- Log.d( "cache_test_DISK_", "image put on disk cache " + key );
+ Log_OC.d( "cache_test_DISK_", "image put on disk cache " + validKey );
}
} else {
editor.abort();
if ( BuildConfig.DEBUG ) {
- Log.d( "cache_test_DISK_", "ERROR on: image put on disk cache " + key );
+ Log_OC.d( "cache_test_DISK_", "ERROR on: image put on disk cache " + validKey );
}
}
} catch (IOException e) {
if ( BuildConfig.DEBUG ) {
- Log.d( "cache_test_DISK_", "ERROR on: image put on disk cache " + key );
+ Log_OC.d( "cache_test_DISK_", "ERROR on: image put on disk cache " + validKey );
}
try {
if ( editor != null ) {
Bitmap bitmap = null;
DiskLruCache.Snapshot snapshot = null;
+ String validKey = convertToValidKey(key);
try {
- snapshot = mDiskCache.get( key );
+ snapshot = mDiskCache.get( validKey );
if ( snapshot == null ) {
return null;
}
}
if ( BuildConfig.DEBUG ) {
- Log.d("cache_test_DISK_", bitmap == null ? "not found" : "image read from disk " + key);
+ Log_OC.d("cache_test_DISK_", bitmap == null ?
+ "not found" : "image read from disk " + validKey);
}
return bitmap;
boolean contained = false;
DiskLruCache.Snapshot snapshot = null;
+ String validKey = convertToValidKey(key);
try {
- snapshot = mDiskCache.get( key );
+ snapshot = mDiskCache.get( validKey );
contained = snapshot != null;
} catch (IOException e) {
e.printStackTrace();
public void clearCache() {
if ( BuildConfig.DEBUG ) {
- Log.d( "cache_test_DISK_", "disk cache CLEARED");
+ Log_OC.d( "cache_test_DISK_", "disk cache CLEARED");
}
try {
mDiskCache.delete();
public File getCacheFolder() {
return mDiskCache.getDirectory();
}
+
+ private String convertToValidKey(String key) {
+ return Integer.toString(key.hashCode());
+ }
+ /**
+ * Remove passed key from cache
+ * @param key
+ */
+ public void removeKey( String key ) {
+ String validKey = convertToValidKey(key);
+ try {
+ mDiskCache.remove(validKey);
+ Log_OC.d(TAG, "removeKey from cache: " + validKey);
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+ }
}
\ No newline at end of file
*/\r
package com.owncloud.android.ui.adapter;\r
\r
-import java.io.File;\r
-import java.io.IOException;\r
-import java.lang.ref.WeakReference;\r
import java.util.Vector;\r
\r
-import org.apache.commons.httpclient.methods.GetMethod;\r
-import org.apache.http.HttpStatus;\r
-\r
import android.accounts.Account;\r
-import android.accounts.AuthenticatorException;\r
-import android.accounts.OperationCanceledException;\r
import android.content.Context;\r
-import android.content.res.Resources;\r
import android.graphics.Bitmap;\r
-import android.graphics.Bitmap.CompressFormat;\r
-import android.graphics.BitmapFactory;\r
-import android.graphics.drawable.BitmapDrawable;\r
-import android.graphics.drawable.Drawable;\r
-import android.media.ThumbnailUtils;\r
-import android.net.Uri;\r
-import android.os.AsyncTask;\r
-import android.util.TypedValue;\r
import android.view.LayoutInflater;\r
import android.view.View;\r
import android.view.ViewGroup;\r
import com.owncloud.android.authentication.AccountUtils;\r
import com.owncloud.android.datamodel.FileDataStorageManager;\r
import com.owncloud.android.datamodel.OCFile;\r
+import com.owncloud.android.datamodel.ThumbnailsCacheManager;\r
+import com.owncloud.android.datamodel.ThumbnailsCacheManager.AsyncDrawable;\r
import com.owncloud.android.files.services.FileDownloader.FileDownloaderBinder;\r
import com.owncloud.android.files.services.FileUploader.FileUploaderBinder;\r
-import com.owncloud.android.lib.common.OwnCloudAccount;\r
-import com.owncloud.android.lib.common.OwnCloudClient;\r
-import com.owncloud.android.lib.common.OwnCloudClientManagerFactory;\r
-import com.owncloud.android.lib.common.accounts.AccountUtils.AccountNotFoundException;\r
import com.owncloud.android.ui.activity.ComponentsGetter;\r
import com.owncloud.android.utils.DisplayUtils;\r
-import com.owncloud.android.utils.Log_OC;\r
+\r
\r
/**\r
* This Adapter populates a ListView with all files and folders in an ownCloud\r
* instance.\r
* \r
* @author Bartek Przybylski\r
- * @Author Tobias Kaminsky\r
- * \r
+ * @author Tobias Kaminsky\r
+ * @author David A. Velasco\r
*/\r
public class FileListListAdapter extends BaseAdapter implements ListAdapter {\r
private final static String PERMISSION_SHARED_WITH_ME = "S";\r
-\r
- private final Context mContext;\r
+ \r
+ private Context mContext;\r
private OCFile mFile = null;\r
private Vector<OCFile> mFiles = null;\r
- private final boolean mJustFolders;\r
-\r
- private FileDataStorageManager mStorageManager;\r
- private Account mAccount;\r
- private final ComponentsGetter mTransferServiceGetter;\r
-\r
- private final Object thumbnailDiskCacheLock = new Object();\r
- private DiskLruImageCache mThumbnailCache;\r
- private boolean mThumbnailCacheStarting = true;\r
- private static final int DISK_CACHE_SIZE = 1024 * 1024 * 10; // 10MB\r
- private static final CompressFormat mCompressFormat = CompressFormat.JPEG;\r
- private static final int mCompressQuality = 70;\r
- private final Bitmap defaultImg;\r
- private OwnCloudClient client;\r
-\r
- public FileListListAdapter(boolean justFolders, Context context, ComponentsGetter transferServiceGetter) {\r
+ private boolean mJustFolders;\r
+\r
+ private FileDataStorageManager mStorageManager;
+ private Account mAccount;
+ private ComponentsGetter mTransferServiceGetter;\r
+ \r
+ public FileListListAdapter(\r
+ boolean justFolders, \r
+ Context context, \r
+ ComponentsGetter transferServiceGetter\r
+ ) {\r
\r
mJustFolders = justFolders;\r
mContext = context;\r
mAccount = AccountUtils.getCurrentOwnCloudAccount(mContext);\r
mTransferServiceGetter = transferServiceGetter;\r
- defaultImg = BitmapFactory.decodeResource(mContext.getResources(),\r
- DisplayUtils.getResourceId("image/png", "default.png"));\r
-\r
- // Initialise disk cache on background thread\r
- new InitDiskCacheTask().execute();\r
-\r
- }\r
-\r
- class InitDiskCacheTask extends AsyncTask<File, Void, Void> {\r
- @Override\r
- protected Void doInBackground(File... params) {\r
- synchronized (thumbnailDiskCacheLock) {\r
- OwnCloudAccount ocAccount;\r
- try {\r
- ocAccount = new OwnCloudAccount(mAccount, mContext);\r
- client = OwnCloudClientManagerFactory.getDefaultSingleton().getClientFor(ocAccount, mContext);\r
- } catch (AccountNotFoundException e) {\r
- // TODO Auto-generated catch block\r
- e.printStackTrace();\r
- } catch (AuthenticatorException e) {\r
- // TODO Auto-generated catch block\r
- e.printStackTrace();\r
- } catch (OperationCanceledException e) {\r
- // TODO Auto-generated catch block\r
- e.printStackTrace();\r
- } catch (IOException e) {\r
- // TODO Auto-generated catch block\r
- e.printStackTrace();\r
- }\r
-\r
- mThumbnailCache = new DiskLruImageCache(mContext, "thumbnailCache", DISK_CACHE_SIZE, mCompressFormat,\r
- mCompressQuality);\r
-\r
- mThumbnailCacheStarting = false; // Finished initialization\r
- thumbnailDiskCacheLock.notifyAll(); // Wake any waiting threads\r
- }\r
- return null;\r
- }\r
- }\r
-\r
- static class AsyncDrawable extends BitmapDrawable {\r
- private final WeakReference<ThumbnailGenerationTask> bitmapWorkerTaskReference;\r
-\r
- public AsyncDrawable(Resources res, Bitmap bitmap, ThumbnailGenerationTask bitmapWorkerTask) {\r
- super(res, bitmap);\r
- bitmapWorkerTaskReference = new WeakReference<ThumbnailGenerationTask>(bitmapWorkerTask);\r
- }\r
-\r
- public ThumbnailGenerationTask getBitmapWorkerTask() {\r
- return bitmapWorkerTaskReference.get();\r
- }\r
- }\r
-\r
- class ThumbnailGenerationTask extends AsyncTask<OCFile, Void, Bitmap> {\r
- private final WeakReference<ImageView> imageViewReference;\r
- private OCFile file;\r
-\r
- public ThumbnailGenerationTask(ImageView imageView) {\r
- // Use a WeakReference to ensure the ImageView can be garbage\r
- // collected\r
- imageViewReference = new WeakReference<ImageView>(imageView);\r
- }\r
-\r
- // Decode image in background.\r
- @Override\r
- protected Bitmap doInBackground(OCFile... params) {\r
- file = params[0];\r
- final String imageKey = String.valueOf(file.getRemoteId().hashCode());\r
- Log_OC.d("Thumbnail", imageKey);\r
-\r
- // Check disk cache in background thread\r
- Bitmap thumbnail = getBitmapFromDiskCache(imageKey);\r
-\r
- // Not found in disk cache\r
- if (thumbnail == null) {\r
- // Converts dp to pixel\r
- Resources r = mContext.getResources();\r
- int px = Math.round(TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, 32, r.getDisplayMetrics()));\r
-\r
- if (file.isDown()) {\r
- Bitmap bitmap = BitmapFactory.decodeFile(file.getStoragePath());\r
-\r
- if (bitmap != null) {\r
- thumbnail = ThumbnailUtils.extractThumbnail(bitmap, px, px);\r
-\r
- // Add thumbnail to cache\r
- addBitmapToCache(imageKey, thumbnail);\r
- }\r
-\r
- } else {\r
- // Download thumbnail from server\r
- try {\r
- int status = -1;\r
-\r
- String uri = client.getBaseUri() + "/index.php/apps/files/api/v1/thumbnail/" + px + "/" + px\r
- + "/" + Uri.encode(file.getRemotePath(), "/");\r
- Log_OC.d("Thumbnail", "URI: " + uri);\r
- GetMethod get = new GetMethod(uri);\r
- status = client.executeMethod(get);\r
- if (status == HttpStatus.SC_OK) {\r
- byte[] bytes = get.getResponseBody();\r
- Bitmap bitmap = BitmapFactory.decodeByteArray(bytes, 0, bytes.length);\r
- thumbnail = ThumbnailUtils.extractThumbnail(bitmap, px, px);\r
-\r
- // Add thumbnail to cache\r
- if (thumbnail != null) {\r
- addBitmapToCache(imageKey, thumbnail);\r
- }\r
- }\r
- } catch (Exception e) {\r
- e.printStackTrace();\r
- }\r
- }\r
- }\r
- return thumbnail;\r
- }\r
\r
- @Override\r
- protected void onPostExecute(Bitmap bitmap) {\r
- if (isCancelled()) {\r
- bitmap = null;\r
- }\r
+ // initialise thumbnails cache on background thread\r
+ new ThumbnailsCacheManager.InitDiskCacheTask(mAccount, mContext).execute();\r
\r
- if (imageViewReference != null && bitmap != null) {\r
- final ImageView imageView = imageViewReference.get();\r
- final ThumbnailGenerationTask bitmapWorkerTask = getBitmapWorkerTask(imageView);\r
- if (this == bitmapWorkerTask && imageView != null) {\r
- imageView.setImageBitmap(bitmap);\r
- }\r
- }\r
- }\r
}\r
-\r
- public void addBitmapToCache(String key, Bitmap bitmap) {\r
- synchronized (thumbnailDiskCacheLock) {\r
- if (mThumbnailCache != null && mThumbnailCache.getBitmap(key) == null) {\r
- mThumbnailCache.put(key, bitmap);\r
- }\r
- }\r
- }\r
-\r
- public Bitmap getBitmapFromDiskCache(String key) {\r
- synchronized (thumbnailDiskCacheLock) {\r
- // Wait while disk cache is started from background thread\r
- while (mThumbnailCacheStarting) {\r
- try {\r
- thumbnailDiskCacheLock.wait();\r
- } catch (InterruptedException e) {\r
- }\r
- }\r
- if (mThumbnailCache != null) {\r
- return mThumbnailCache.getBitmap(key);\r
- }\r
- }\r
- return null;\r
- }\r
-\r
+ \r
@Override\r
public boolean areAllItemsEnabled() {\r
return true;\r
public View getView(int position, View convertView, ViewGroup parent) {\r
View view = convertView;\r
if (view == null) {\r
- LayoutInflater inflator = (LayoutInflater) mContext.getSystemService(Context.LAYOUT_INFLATER_SERVICE);\r
+ LayoutInflater inflator = (LayoutInflater) mContext\r
+ .getSystemService(Context.LAYOUT_INFLATER_SERVICE);\r
view = inflator.inflate(R.layout.list_item, null);\r
}\r
-\r
+ \r
if (mFiles != null && mFiles.size() > position) {\r
OCFile file = mFiles.get(position);\r
- TextView fileName = (TextView) view.findViewById(R.id.Filename);\r
+ TextView fileName = (TextView) view.findViewById(R.id.Filename); \r
String name = file.getFileName();\r
\r
fileName.setText(name);\r
ImageView fileIcon = (ImageView) view.findViewById(R.id.imageView1);\r
+ fileIcon.setTag(file.getFileId());\r
ImageView sharedIconV = (ImageView) view.findViewById(R.id.sharedIcon);\r
ImageView sharedWithMeIconV = (ImageView) view.findViewById(R.id.sharedWithMeIcon);\r
sharedWithMeIconV.setVisibility(View.GONE);\r
\r
ImageView localStateView = (ImageView) view.findViewById(R.id.imageView2);\r
localStateView.bringToFront();\r
- FileDownloaderBinder downloaderBinder = mTransferServiceGetter.getFileDownloaderBinder();\r
+ FileDownloaderBinder downloaderBinder = \r
+ mTransferServiceGetter.getFileDownloaderBinder();\r
FileUploaderBinder uploaderBinder = mTransferServiceGetter.getFileUploaderBinder();\r
if (downloaderBinder != null && downloaderBinder.isDownloading(mAccount, file)) {\r
localStateView.setImageResource(R.drawable.downloading_file_indicator);\r
} else {\r
localStateView.setVisibility(View.INVISIBLE);\r
}\r
-\r
+ \r
TextView fileSizeV = (TextView) view.findViewById(R.id.file_size);\r
TextView lastModV = (TextView) view.findViewById(R.id.last_mod);\r
ImageView checkBoxV = (ImageView) view.findViewById(R.id.custom_checkbox);\r
-\r
+ \r
if (!file.isFolder()) {\r
fileSizeV.setVisibility(View.VISIBLE);\r
fileSizeV.setText(DisplayUtils.bytesToHumanReadable(file.getFileLength()));\r
lastModV.setVisibility(View.VISIBLE);\r
- lastModV.setText(DisplayUtils.unixTimeToHumanReadable(file.getModificationTimestamp()));\r
- // this if-else is needed even thoe fav icon is visible by\r
- // default\r
+ lastModV.setText(\r
+ DisplayUtils.unixTimeToHumanReadable(file.getModificationTimestamp())\r
+ );\r
+ // this if-else is needed even thoe fav icon is visible by default\r
// because android reuses views in listview\r
if (!file.keepInSync()) {\r
view.findViewById(R.id.imageView3).setVisibility(View.GONE);\r
} else {\r
view.findViewById(R.id.imageView3).setVisibility(View.VISIBLE);\r
}\r
-\r
- ListView parentList = (ListView) parent;\r
- if (parentList.getChoiceMode() == ListView.CHOICE_MODE_NONE) {\r
+ \r
+ ListView parentList = (ListView)parent;\r
+ if (parentList.getChoiceMode() == ListView.CHOICE_MODE_NONE) { \r
checkBoxV.setVisibility(View.GONE);\r
} else {\r
if (parentList.isItemChecked(position)) {\r
checkBoxV.setImageResource(android.R.drawable.checkbox_off_background);\r
}\r
checkBoxV.setVisibility(View.VISIBLE);\r
- }\r
-\r
+ } \r
+ \r
// get Thumbnail if file is image\r
- if (file.isImage()) {\r
- // Thumbnail in Cache?\r
- Bitmap thumbnail = getBitmapFromDiskCache(String.valueOf(file.getRemoteId().hashCode()));\r
- if (thumbnail != null) {\r
+ if (file.isImage() && file.getRemoteId() != null){\r
+ // Thumbnail in Cache?\r
+ Bitmap thumbnail = ThumbnailsCacheManager.getBitmapFromDiskCache(\r
+ String.valueOf(file.getRemoteId())\r
+ );\r
+ if (thumbnail != null && !file.needsUpdateThumbnail()){\r
fileIcon.setImageBitmap(thumbnail);\r
} else {\r
// generate new Thumbnail\r
- if (cancelPotentialWork(file, fileIcon)) {\r
- final ThumbnailGenerationTask task = new ThumbnailGenerationTask(fileIcon);\r
- final AsyncDrawable asyncDrawable = new AsyncDrawable(mContext.getResources(), defaultImg,\r
- task);\r
+ if (ThumbnailsCacheManager.cancelPotentialWork(file, fileIcon)) {\r
+ final ThumbnailsCacheManager.ThumbnailGenerationTask task = \r
+ new ThumbnailsCacheManager.ThumbnailGenerationTask(\r
+ fileIcon, mStorageManager\r
+ );\r
+ if (thumbnail == null) {\r
+ thumbnail = ThumbnailsCacheManager.mDefaultImg;\r
+ }\r
+ final AsyncDrawable asyncDrawable = new AsyncDrawable(\r
+ mContext.getResources(), \r
+ thumbnail, \r
+ task\r
+ );\r
fileIcon.setImageDrawable(asyncDrawable);\r
task.execute(file);\r
}\r
}\r
} else {\r
- fileIcon.setImageResource(DisplayUtils.getResourceId(file.getMimetype(), file.getFileName()));\r
+ fileIcon.setImageResource(\r
+ DisplayUtils.getResourceId(file.getMimetype(), file.getFileName())\r
+ );\r
}\r
-\r
+
if (checkIfFileIsSharedWithMe(file)) {\r
sharedWithMeIconV.setVisibility(View.VISIBLE);\r
}\r
- } else {\r
+ } \r
+ else {\r
fileSizeV.setVisibility(View.INVISIBLE);\r
- // fileSizeV.setText(DisplayUtils.bytesToHumanReadable(file.getFileLength()));\r
+ //fileSizeV.setText(DisplayUtils.bytesToHumanReadable(file.getFileLength()));\r
lastModV.setVisibility(View.VISIBLE);\r
- lastModV.setText(DisplayUtils.unixTimeToHumanReadable(file.getModificationTimestamp()));\r
+ lastModV.setText(\r
+ DisplayUtils.unixTimeToHumanReadable(file.getModificationTimestamp())\r
+ );\r
checkBoxV.setVisibility(View.GONE);\r
view.findViewById(R.id.imageView3).setVisibility(View.GONE);\r
\r
fileIcon.setImageResource(R.drawable.shared_with_me_folder);\r
sharedWithMeIconV.setVisibility(View.VISIBLE);\r
} else {\r
- fileIcon.setImageResource(DisplayUtils.getResourceId(file.getMimetype(), file.getFileName()));\r
+ fileIcon.setImageResource(\r
+ DisplayUtils.getResourceId(file.getMimetype(), file.getFileName())\r
+ );\r
}\r
\r
// If folder is sharedByLink, icon folder must be changed to\r
\r
return view;\r
}\r
-\r
- public static boolean cancelPotentialWork(OCFile file, ImageView imageView) {\r
- final ThumbnailGenerationTask bitmapWorkerTask = getBitmapWorkerTask(imageView);\r
-\r
- if (bitmapWorkerTask != null) {\r
- final OCFile bitmapData = bitmapWorkerTask.file;\r
- // If bitmapData is not yet set or it differs from the new data\r
- if (bitmapData == null || bitmapData != file) {\r
- // Cancel previous task\r
- bitmapWorkerTask.cancel(true);\r
- } else {\r
- // The same work is already in progress\r
- return false;\r
- }\r
- }\r
- // No task associated with the ImageView, or an existing task was\r
- // cancelled\r
- return true;\r
- }\r
-\r
- private static ThumbnailGenerationTask getBitmapWorkerTask(ImageView imageView) {\r
- if (imageView != null) {\r
- final Drawable drawable = imageView.getDrawable();\r
- if (drawable instanceof AsyncDrawable) {\r
- final AsyncDrawable asyncDrawable = (AsyncDrawable) drawable;\r
- return asyncDrawable.getBitmapWorkerTask();\r
- }\r
- }\r
- return null;\r
- }\r
-\r
+ \r
@Override\r
public int getViewTypeCount() {\r
return 1;\r
\r
/**\r
* Change the adapted directory for a new one\r
- * \r
- * @param directory New file to adapt. Can be NULL, meaning\r
- * "no content to adapt".\r
- * @param updatedStorageManager Optional updated storage manager; used to\r
- * replace mStorageManager if is different (and not NULL)\r
+ * @param directory New file to adapt. Can be NULL, meaning \r
+ * "no content to adapt".\r
+ * @param updatedStorageManager Optional updated storage manager; used to replace \r
+ * mStorageManager if is different (and not NULL)\r
*/\r
public void swapDirectory(OCFile directory, FileDataStorageManager updatedStorageManager) {\r
mFile = directory;\r
}\r
notifyDataSetChanged();\r
}\r
-\r
+ \r
+ \r
/**\r
* Filter for getting only the folders\r
- * \r
* @param files\r
* @return Vector<OCFile>\r
*/\r
public Vector<OCFile> getFolders(Vector<OCFile> files) {\r
- Vector<OCFile> ret = new Vector<OCFile>();\r
- OCFile current = null;\r
- for (int i = 0; i < files.size(); i++) {\r
+ Vector<OCFile> ret = new Vector<OCFile>(); \r
+ OCFile current = null; \r
+ for (int i=0; i<files.size(); i++) {\r
current = files.get(i);\r
if (current.isFolder()) {\r
ret.add(current);\r
}\r
return ret;\r
}\r
-\r
+ \r
+ \r
/**\r
* Check if parent folder does not include 'S' permission and if file/folder\r
* is shared with me\r
* @return boolean: True if it is shared with me and false if it is not\r
*/\r
private boolean checkIfFileIsSharedWithMe(OCFile file) {\r
- return (mFile.getPermissions() != null && !mFile.getPermissions().contains(PERMISSION_SHARED_WITH_ME)\r
- && file.getPermissions() != null && file.getPermissions().contains(PERMISSION_SHARED_WITH_ME));\r
+ return (mFile.getPermissions() != null \r
+ && !mFile.getPermissions().contains(PERMISSION_SHARED_WITH_ME)\r
+ && file.getPermissions() != null \r
+ && file.getPermissions().contains(PERMISSION_SHARED_WITH_ME));\r
}\r
}\r
import android.os.Bundle;
import com.actionbarsherlock.app.SherlockDialogFragment;
-import com.owncloud.android.utils.Log_OC;
+import com.owncloud.android.lib.common.utils.Log_OC;
public class ConfirmationDialogFragment extends SherlockDialogFragment {
import com.owncloud.android.authentication.SsoWebViewClient;
import com.owncloud.android.authentication.SsoWebViewClient.SsoWebViewClientListener;
import com.owncloud.android.lib.common.OwnCloudClient;
-import com.owncloud.android.utils.Log_OC;
+import com.owncloud.android.lib.common.utils.Log_OC;
/**
import com.actionbarsherlock.app.SherlockDialogFragment;
import com.owncloud.android.R;
import com.owncloud.android.datamodel.OCFile;
+import com.owncloud.android.lib.common.utils.Log_OC;
import com.owncloud.android.ui.activity.ComponentsGetter;
import com.owncloud.android.ui.activity.CopyToClipboardActivity;
import com.owncloud.android.ui.activity.FileActivity;
-import com.owncloud.android.utils.Log_OC;
/**
* Dialog showing a list activities able to resolve a given Intent,
import com.owncloud.android.R;
import com.owncloud.android.lib.common.network.CertificateCombinedException;
import com.owncloud.android.lib.common.network.NetworkUtils;
+import com.owncloud.android.lib.common.utils.Log_OC;
import com.owncloud.android.ui.adapter.CertificateCombinedExceptionViewAdapter;
import com.owncloud.android.ui.adapter.SslCertificateViewAdapter;
import com.owncloud.android.ui.adapter.SslErrorViewAdapter;
import com.owncloud.android.ui.adapter.X509CertificateViewAdapter;
-import com.owncloud.android.utils.Log_OC;
/**
* Dialog to show information about an untrusted certificate and allow the user
import com.owncloud.android.lib.common.network.CertificateCombinedException;
import com.owncloud.android.lib.common.network.NetworkUtils;
import com.owncloud.android.lib.common.operations.RemoteOperationResult;
-import com.owncloud.android.utils.Log_OC;
+import com.owncloud.android.lib.common.utils.Log_OC;
/**
* Dialog to request the user about a certificate that could not be validated with the certificates store in the system.
import com.actionbarsherlock.app.SherlockFragment;
import com.owncloud.android.R;
+import com.owncloud.android.lib.common.utils.Log_OC;
import com.owncloud.android.ui.ExtendedListView;
-import com.owncloud.android.utils.Log_OC;
+import com.owncloud.android.ui.activity.OnEnforceableRefreshListener;
/**
* TODO extending SherlockListFragment instead of SherlockFragment
*/
public class ExtendedListFragment extends SherlockFragment
-implements OnItemClickListener, SwipeRefreshLayout.OnRefreshListener {
+implements OnItemClickListener, OnEnforceableRefreshListener {
private static final String TAG = ExtendedListFragment.class.getSimpleName();
private ArrayList<Integer> mTops;
private int mHeightCell = 0;
- private SwipeRefreshLayout.OnRefreshListener mOnRefreshListener = null;
+ private OnEnforceableRefreshListener mOnRefreshListener = null;
public void setListAdapter(ListAdapter listAdapter) {
}
}
- public void setOnRefreshListener(SwipeRefreshLayout.OnRefreshListener listener) {
+ public void setOnRefreshListener(OnEnforceableRefreshListener listener) {
mOnRefreshListener = listener;
}
refreshLayout.setOnRefreshListener(this);
}
+ @Override
+ public void onRefresh(boolean ignoreETag) {
+ mRefreshLayout.setRefreshing(false);
+ mRefreshEmptyLayout.setRefreshing(false);
+
+ if (mOnRefreshListener != null) {
+ mOnRefreshListener.onRefresh(ignoreETag);
+ }
+ }
}
import com.owncloud.android.files.services.FileDownloader.FileDownloaderBinder;
import com.owncloud.android.files.services.FileUploader.FileUploaderBinder;
import com.owncloud.android.lib.common.network.OnDatatransferProgressListener;
+import com.owncloud.android.lib.common.utils.Log_OC;
import com.owncloud.android.services.observer.FileObserverService;
import com.owncloud.android.ui.activity.FileActivity;
import com.owncloud.android.ui.activity.FileDisplayActivity;
import com.owncloud.android.ui.dialog.RemoveFileDialogFragment;
import com.owncloud.android.ui.dialog.RenameFileDialogFragment;
import com.owncloud.android.utils.DisplayUtils;
-import com.owncloud.android.utils.Log_OC;
/**
import android.widget.ListView;
import com.owncloud.android.R;
+import com.owncloud.android.lib.common.utils.Log_OC;
import com.owncloud.android.ui.adapter.LocalFileListAdapter;
-import com.owncloud.android.utils.Log_OC;
/**
import com.owncloud.android.datamodel.FileDataStorageManager;
import com.owncloud.android.datamodel.OCFile;
import com.owncloud.android.files.FileMenuFilter;
+import com.owncloud.android.lib.common.utils.Log_OC;
import com.owncloud.android.ui.activity.FileDisplayActivity;
import com.owncloud.android.ui.activity.MoveActivity;
+import com.owncloud.android.ui.activity.OnEnforceableRefreshListener;
import com.owncloud.android.ui.adapter.FileListListAdapter;
import com.owncloud.android.ui.dialog.ConfirmationDialogFragment;
import com.owncloud.android.ui.dialog.RemoveFileDialogFragment;
import com.owncloud.android.ui.dialog.RenameFileDialogFragment;
import com.owncloud.android.ui.preview.PreviewImageFragment;
import com.owncloud.android.ui.preview.PreviewMediaFragment;
-import com.owncloud.android.utils.Log_OC;
/**
* A Fragment that lists all files and folders in a given path.
FileFragment.ContainerActivity.class.getSimpleName());
}
try {
- setOnRefreshListener((SwipeRefreshLayout.OnRefreshListener) activity);
+ setOnRefreshListener((OnEnforceableRefreshListener) activity);
} catch (ClassCastException e) {
throw new ClassCastException(activity.toString() + " must implement " +
listDirectory(mFile);
- onRefresh();
+ onRefresh(false);
// restore index and top position
restoreIndexAndTopPosition();
import com.owncloud.android.datamodel.OCFile;
import com.owncloud.android.files.services.FileDownloader.FileDownloaderBinder;
import com.owncloud.android.ui.fragment.FileFragment;
-import com.owncloud.android.utils.Log_OC;
import android.accounts.Account;
import android.os.Bundle;
import android.view.View.OnClickListener;
import android.view.ViewGroup;
import android.widget.ImageButton;
+import android.widget.LinearLayout;
import android.widget.ProgressBar;
import android.widget.TextView;
import com.owncloud.android.lib.common.network.OnDatatransferProgressListener;
+import com.owncloud.android.lib.common.utils.Log_OC;
/**
((ImageButton)mView.findViewById(R.id.cancelBtn)).setOnClickListener(this);
+ ((LinearLayout)mView.findViewById(R.id.fileDownloadLL)).setOnClickListener(new OnClickListener() {
+ @Override
+ public void onClick(View v) {
+ ((PreviewImageActivity) getActivity()).toggleFullScreen();
+ }
+ });
+
if (mError) {
setButtonsForRemote();
} else {
--- /dev/null
+package com.owncloud.android.ui.preview;
+
+import android.annotation.SuppressLint;
+import android.content.Context;
+import android.graphics.Bitmap;
+import android.graphics.Canvas;
+import android.os.Build;
+import android.util.AttributeSet;
+import android.view.View;
+import android.widget.ImageView;
+
+import com.owncloud.android.lib.common.utils.Log_OC;
+
+public class ImageViewCustom extends ImageView {
+
+ private static final boolean IS_ICS_OR_HIGHER = Build.VERSION.SDK_INT >= Build.VERSION_CODES.ICE_CREAM_SANDWICH;
+
+ private Bitmap mBitmap;
+
+
+ public ImageViewCustom(Context context) {
+ super(context);
+ }
+
+ public ImageViewCustom(Context context, AttributeSet attrs) {
+ super(context, attrs);
+ }
+
+ public ImageViewCustom(Context context, AttributeSet attrs, int defStyle) {
+ super(context, attrs, defStyle);
+ }
+
+ @SuppressLint("NewApi")
+ @Override
+ protected void onDraw(Canvas canvas) {
+
+ if(IS_ICS_OR_HIGHER && checkIfMaximumBitmapExceed(canvas)) {
+ // Set layer type to software one for avoiding exceed
+ // and problems in visualization
+ setLayerType(View.LAYER_TYPE_SOFTWARE, null);
+ }
+
+ super.onDraw(canvas);
+ }
+
+ /**
+ * Checks if current bitmaps exceed the maximum OpenGL texture size limit
+ * @param bitmap
+ * @return boolean
+ */
+ @SuppressLint("NewApi")
+ private boolean checkIfMaximumBitmapExceed(Canvas canvas) {
+ Log_OC.d("OC", "Canvas maximum: " + canvas.getMaximumBitmapWidth() + " - " + canvas.getMaximumBitmapHeight());
+ if (mBitmap!= null && (mBitmap.getWidth() > canvas.getMaximumBitmapWidth()
+ || mBitmap.getHeight() > canvas.getMaximumBitmapHeight())) {
+ return true;
+ }
+
+ return false;
+ }
+
+ /**
+ * Set current bitmap
+ * @param bitmap
+ */
+ public void setBitmap (Bitmap bitmap) {
+ mBitmap = bitmap;
+ }
+
+}
import com.owncloud.android.lib.common.operations.RemoteOperation;
import com.owncloud.android.lib.common.operations.RemoteOperationResult;
import com.owncloud.android.lib.common.operations.RemoteOperationResult.ResultCode;
+import com.owncloud.android.lib.common.utils.Log_OC;
import com.owncloud.android.operations.CreateShareOperation;
import com.owncloud.android.operations.RemoveFileOperation;
import com.owncloud.android.operations.UnshareLinkOperation;
import com.owncloud.android.ui.activity.PinCodeActivity;
import com.owncloud.android.ui.fragment.FileFragment;
import com.owncloud.android.utils.DisplayUtils;
-import com.owncloud.android.utils.Log_OC;
/**
@Override
protected void onResume() {
super.onResume();
- //Log.e(TAG, "ACTIVITY, ONRESUME");
+ //Log_OC.e(TAG, "ACTIVITY, ONRESUME");
mDownloadFinishReceiver = new DownloadFinishReceiver();
IntentFilter filter = new IntentFilter(FileDownloader.getDownloadFinishMessage());
@Override
protected void onPostResume() {
- //Log.e(TAG, "ACTIVITY, ONPOSTRESUME");
+ //Log_OC.e(TAG, "ACTIVITY, ONPOSTRESUME");
super.onPostResume();
}
*/
package com.owncloud.android.ui.preview;
+import java.io.BufferedInputStream;
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FilterInputStream;
+import java.io.IOException;
+import java.io.InputStream;
import java.lang.ref.WeakReference;
import android.accounts.Account;
import com.actionbarsherlock.view.Menu;
import com.actionbarsherlock.view.MenuInflater;
import com.actionbarsherlock.view.MenuItem;
-import com.ortiz.touch.TouchImageView;
import com.owncloud.android.R;
import com.owncloud.android.datamodel.OCFile;
import com.owncloud.android.files.FileMenuFilter;
+import com.owncloud.android.lib.common.utils.Log_OC;
import com.owncloud.android.ui.dialog.ConfirmationDialogFragment;
import com.owncloud.android.ui.dialog.RemoveFileDialogFragment;
import com.owncloud.android.ui.fragment.FileFragment;
-import com.owncloud.android.utils.Log_OC;
+import com.owncloud.android.utils.TouchImageViewCustom;
+
/**
* @author David A. Velasco
*/
public class PreviewImageFragment extends FileFragment {
+
public static final String EXTRA_FILE = "FILE";
public static final String EXTRA_ACCOUNT = "ACCOUNT";
private View mView;
private Account mAccount;
- private TouchImageView mImageView;
+ private TouchImageViewCustom mImageView;
private TextView mMessageView;
private ProgressBar mProgressWheel;
Bundle savedInstanceState) {
super.onCreateView(inflater, container, savedInstanceState);
mView = inflater.inflate(R.layout.preview_image_fragment, container, false);
- mImageView = (TouchImageView) mView.findViewById(R.id.image);
+ mImageView = (TouchImageViewCustom) mView.findViewById(R.id.image);
mImageView.setVisibility(View.GONE);
mImageView.setOnClickListener(new OnClickListener() {
@Override
public void onDestroy() {
if (mBitmap != null) {
mBitmap.recycle();
+ System.gc();
}
super.onDestroy();
}
*
* Using a weak reference will avoid memory leaks if the target ImageView is retired from memory before the load finishes.
*/
- private final WeakReference<ImageView> mImageViewRef;
+ private final WeakReference<ImageViewCustom> mImageViewRef;
/**
* Weak reference to the target {@link TextView} where error messages will be written.
*
* @param imageView Target {@link ImageView} where the bitmap will be loaded into.
*/
- public BitmapLoader(ImageView imageView, TextView messageView, ProgressBar progressWheel) {
- mImageViewRef = new WeakReference<ImageView>(imageView);
+ public BitmapLoader(ImageViewCustom imageView, TextView messageView, ProgressBar progressWheel) {
+ mImageViewRef = new WeakReference<ImageViewCustom>(imageView);
mMessageViewRef = new WeakReference<TextView>(messageView);
mProgressWheelRef = new WeakReference<ProgressBar>(progressWheel);
}
- @SuppressWarnings("deprecation")
- @SuppressLint({ "NewApi", "NewApi", "NewApi" }) // to avoid Lint errors since Android SDK r20
- @Override
+ @Override
protected Bitmap doInBackground(String... params) {
Bitmap result = null;
if (params.length != 1) return result;
String storagePath = params[0];
try {
- // set desired options that will affect the size of the bitmap
- BitmapFactory.Options options = new Options();
- options.inScaled = true;
- options.inPurgeable = true;
- if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.GINGERBREAD_MR1) {
- options.inPreferQualityOverSpeed = false;
- }
- if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.HONEYCOMB) {
- options.inMutable = false;
- }
- // make a false load of the bitmap - just to be able to read outWidth, outHeight and outMimeType
- options.inJustDecodeBounds = true;
- BitmapFactory.decodeFile(storagePath, options);
-
- int width = options.outWidth;
- int height = options.outHeight;
- int scale = 1;
-
- Display display = getActivity().getWindowManager().getDefaultDisplay();
- Point size = new Point();
- int screenWidth;
- int screenHeight;
- if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.HONEYCOMB_MR2) {
- display.getSize(size);
- screenWidth = size.x;
- screenHeight = size.y;
- } else {
- screenWidth = display.getWidth();
- screenHeight = display.getHeight();
- }
- if (width > screenWidth) {
- // second try to scale down the image , this time depending upon the screen size
- scale = (int) Math.floor((float)width / screenWidth);
- }
- if (height > screenHeight) {
- scale = Math.max(scale, (int) Math.floor((float)height / screenHeight));
- }
- options.inSampleSize = scale;
+ File picture = new File(storagePath);
- // really load the bitmap
- options.inJustDecodeBounds = false; // the next decodeFile call will be real
- result = BitmapFactory.decodeFile(storagePath, options);
- //Log_OC.d(TAG, "Image loaded - width: " + options.outWidth + ", loaded height: " + options.outHeight);
+ if (picture != null) {
+ //Decode file into a bitmap in real size for being able to make zoom on the image
+ result = BitmapFactory.decodeStream(new FlushedInputStream
+ (new BufferedInputStream(new FileInputStream(picture))));
+ }
if (result == null) {
mErrorMessageId = R.string.preview_image_error_unknown_format;
}
} catch (OutOfMemoryError e) {
- mErrorMessageId = R.string.preview_image_error_unknown_format;
Log_OC.e(TAG, "Out of memory occured for file " + storagePath, e);
+
+ // If out of memory error when loading image, try to load it scaled
+ result = loadScaledImage(storagePath);
+
+ if (result == null) {
+ mErrorMessageId = R.string.preview_image_error_unknown_format;
+ Log_OC.e(TAG, "File could not be loaded as a bitmap: " + storagePath);
+ }
} catch (NoSuchFieldError e) {
mErrorMessageId = R.string.common_error_unknown;
showErrorMessage();
}
}
-
+
+ @SuppressLint("InlinedApi")
private void showLoadedImage(Bitmap result) {
if (mImageViewRef != null) {
- final ImageView imageView = mImageViewRef.get();
+ final ImageViewCustom imageView = mImageViewRef.get();
if (imageView != null) {
+ imageView.setBitmap(result);
imageView.setImageBitmap(result);
imageView.setVisibility(View.VISIBLE);
mBitmap = result;
container.finish();
}
- public TouchImageView getImageView() {
+ public TouchImageViewCustom getImageView() {
return mImageView;
}
-
+
+ static class FlushedInputStream extends FilterInputStream {
+ public FlushedInputStream(InputStream inputStream) {
+ super(inputStream);
+ }
+
+ @Override
+ public long skip(long n) throws IOException {
+ long totalBytesSkipped = 0L;
+ while (totalBytesSkipped < n) {
+ long bytesSkipped = in.skip(n - totalBytesSkipped);
+ if (bytesSkipped == 0L) {
+ int byteValue = read();
+ if (byteValue < 0) {
+ break; // we reached EOF
+ } else {
+ bytesSkipped = 1; // we read one byte
+ }
+ }
+ totalBytesSkipped += bytesSkipped;
+ }
+ return totalBytesSkipped;
+ }
+ }
+
+ /**
+ * Load image scaled
+ * @param storagePath: path of the image
+ * @return Bitmap
+ */
+ @SuppressWarnings("deprecation")
+ private Bitmap loadScaledImage(String storagePath) {
+
+ Log_OC.d(TAG, "Loading image scaled");
+
+ // set desired options that will affect the size of the bitmap
+ BitmapFactory.Options options = new Options();
+ options.inScaled = true;
+ options.inPurgeable = true;
+ if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.GINGERBREAD_MR1) {
+ options.inPreferQualityOverSpeed = false;
+ }
+ if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.HONEYCOMB) {
+ options.inMutable = false;
+ }
+ // make a false load of the bitmap - just to be able to read outWidth, outHeight and outMimeType
+ options.inJustDecodeBounds = true;
+ BitmapFactory.decodeFile(storagePath, options);
+
+ int width = options.outWidth;
+ int height = options.outHeight;
+ int scale = 1;
+
+ Display display = getActivity().getWindowManager().getDefaultDisplay();
+ Point size = new Point();
+ int screenWidth;
+ int screenHeight;
+ if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.HONEYCOMB_MR2) {
+ display.getSize(size);
+ screenWidth = size.x;
+ screenHeight = size.y;
+ } else {
+ screenWidth = display.getWidth();
+ screenHeight = display.getHeight();
+ }
+
+ if (width > screenWidth) {
+ // second try to scale down the image , this time depending upon the screen size
+ scale = (int) Math.floor((float)width / screenWidth);
+ }
+ if (height > screenHeight) {
+ scale = Math.max(scale, (int) Math.floor((float)height / screenHeight));
+ }
+ options.inSampleSize = scale;
+
+ // really load the bitmap
+ options.inJustDecodeBounds = false; // the next decodeFile call will be real
+ return BitmapFactory.decodeFile(storagePath, options);
+
+ }
}
*- /
@Override
public void startUpdate(ViewGroup container) {
- Log.e(TAG, "** startUpdate");
+ Log_OC.e(TAG, "** startUpdate");
}
@Override
public Object instantiateItem(ViewGroup container, int position) {
- Log.e(TAG, "** instantiateItem " + position);
+ Log_OC.e(TAG, "** instantiateItem " + position);
if (mFragments.size() > position) {
Fragment fragment = mFragments.get(position);
if (fragment != null) {
- Log.e(TAG, "** \t returning cached item");
+ Log_OC.e(TAG, "** \t returning cached item");
return fragment;
}
}
}
fragment.setMenuVisibility(false);
mFragments.set(position, fragment);
- //Log.e(TAG, "** \t adding fragment at position " + position + ", containerId " + container.getId());
+ //Log_OC.e(TAG, "** \t adding fragment at position " + position + ", containerId " + container.getId());
mCurTransaction.add(container.getId(), fragment);
return fragment;
@Override
public void destroyItem(ViewGroup container, int position, Object object) {
- Log.e(TAG, "** destroyItem " + position);
+ Log_OC.e(TAG, "** destroyItem " + position);
Fragment fragment = (Fragment)object;
if (mCurTransaction == null) {
mCurTransaction = mFragmentManager.beginTransaction();
}
- Log.e(TAG, "** \t removing fragment at position " + position);
+ Log_OC.e(TAG, "** \t removing fragment at position " + position);
while (mSavedState.size() <= position) {
mSavedState.add(null);
}
@Override
public void finishUpdate(ViewGroup container) {
- Log.e(TAG, "** finishUpdate (start)");
+ Log_OC.e(TAG, "** finishUpdate (start)");
if (mCurTransaction != null) {
mCurTransaction.commitAllowingStateLoss();
mCurTransaction = null;
mFragmentManager.executePendingTransactions();
}
- Log.e(TAG, "** finishUpdate (end)");
+ Log_OC.e(TAG, "** finishUpdate (end)");
}
@Override
f.setMenuVisibility(false);
mFragments.set(index, f);
} else {
- Log.w(TAG, "Bad fragment at key " + key);
+ Log_OC.w(TAG, "Bad fragment at key " + key);
}
}
}
import android.media.MediaPlayer.OnCompletionListener;
import android.media.MediaPlayer.OnErrorListener;
import android.media.MediaPlayer.OnPreparedListener;
+import android.net.Uri;
import android.os.Build;
import android.os.Bundle;
import android.os.IBinder;
import com.owncloud.android.R;
import com.owncloud.android.datamodel.OCFile;
import com.owncloud.android.files.FileMenuFilter;
+import com.owncloud.android.lib.common.utils.Log_OC;
import com.owncloud.android.media.MediaControlView;
import com.owncloud.android.media.MediaService;
import com.owncloud.android.media.MediaServiceBinder;
import com.owncloud.android.ui.dialog.ConfirmationDialogFragment;
import com.owncloud.android.ui.dialog.RemoveFileDialogFragment;
import com.owncloud.android.ui.fragment.FileFragment;
-import com.owncloud.android.utils.Log_OC;
/**
mVideoPreview.setOnErrorListener(mVideoHelper);
}
+ @SuppressWarnings("static-access")
private void playVideo() {
// create and prepare control panel for the user
mMediaController.setMediaPlayer(mVideoPreview);
// load the video file in the video player ;
// when done, VideoHelper#onPrepared() will be called
- mVideoPreview.setVideoPath(getFile().getStoragePath());
+ Uri uri = Uri.parse(getFile().getStoragePath());
+ mVideoPreview.setVideoPath(uri.encode(getFile().getStoragePath()));
}
import com.owncloud.android.datamodel.OCFile;
import com.owncloud.android.media.MediaService;
import com.owncloud.android.ui.activity.FileActivity;
-import com.owncloud.android.utils.Log_OC;
import android.accounts.Account;
import android.app.AlertDialog;
import com.owncloud.android.lib.common.accounts.AccountUtils;
import com.owncloud.android.lib.common.accounts.AccountUtils.AccountNotFoundException;
+import com.owncloud.android.lib.common.utils.Log_OC;
/**
* Activity implementing a basic video player.
--- /dev/null
+/* ownCloud Android client application
+ * Copyright (C) 2012-2014 ownCloud Inc.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2,
+ * as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+package com.owncloud.android.utils;
+
+import android.graphics.Bitmap;
+import android.graphics.BitmapFactory;
+import android.graphics.BitmapFactory.Options;
+
+/**
+ * Utility class with methods for decoding Bitmaps.
+ *
+ * @author David A. Velasco
+ */
+public class BitmapUtils {
+
+
+ /**
+ * Decodes a bitmap from a file containing it minimizing the memory use, known that the bitmap
+ * will be drawn in a surface of reqWidth x reqHeight
+ *
+ * @param srcPath Absolute path to the file containing the image.
+ * @param reqWidth Width of the surface where the Bitmap will be drawn on, in pixels.
+ * @param reqHeight Height of the surface where the Bitmap will be drawn on, in pixels.
+ * @return
+ */
+ public static Bitmap decodeSampledBitmapFromFile(String srcPath, int reqWidth, int reqHeight) {
+
+ // set desired options that will affect the size of the bitmap
+ final Options options = new Options();
+ options.inScaled = true;
+ options.inPurgeable = true;
+ if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.GINGERBREAD_MR1) {
+ options.inPreferQualityOverSpeed = false;
+ }
+ if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.HONEYCOMB) {
+ options.inMutable = false;
+ }
+
+ // make a false load of the bitmap to get its dimensions
+ options.inJustDecodeBounds = true;
+
+ BitmapFactory.decodeFile(srcPath, options);
+
+ // calculate factor to subsample the bitmap
+ options.inSampleSize = calculateSampleFactor(options, reqWidth, reqHeight);
+
+ // decode bitmap with inSampleSize set
+ options.inJustDecodeBounds = false;
+ return BitmapFactory.decodeFile(srcPath, options);
+
+ }
+
+
+ /**
+ * Calculates a proper value for options.inSampleSize in order to decode a Bitmap minimizing
+ * the memory overload and covering a target surface of reqWidth x reqHeight if the original
+ * image is big enough.
+ *
+ * @param options Bitmap decoding options; options.outHeight and options.inHeight should
+ * be set.
+ * @param reqWidth Width of the surface where the Bitmap will be drawn on, in pixels.
+ * @param reqHeight Height of the surface where the Bitmap will be drawn on, in pixels.
+ * @return The largest inSampleSize value that is a power of 2 and keeps both
+ * height and width larger than reqWidth and reqHeight.
+ */
+ private static int calculateSampleFactor(Options options, int reqWidth, int reqHeight) {
+
+ final int height = options.outHeight;
+ final int width = options.outWidth;
+ int inSampleSize = 1;
+
+ if (height > reqHeight || width > reqWidth) {
+ final int halfHeight = height / 2;
+ final int halfWidth = width / 2;
+
+ while ((halfHeight / inSampleSize) > reqHeight
+ && (halfWidth / inSampleSize) > reqWidth) {
+ inSampleSize *= 2;
+ }
+ }
+
+ return inSampleSize;
+ }
+
+}
import android.annotation.SuppressLint;
import android.content.Context;
+import android.content.SharedPreferences;
+import android.preference.PreferenceManager;
import android.net.Uri;
import android.os.Environment;
import android.os.StatFs;
}
public static String getInstantUploadFilePath(Context context, String fileName) {
- String uploadPath = context.getString(R.string.instant_upload_path);
+ SharedPreferences pref = PreferenceManager.getDefaultSharedPreferences(context);
+ String uploadPathdef = context.getString(R.string.instant_upload_path);
+ String uploadPath = pref.getString("instant_upload_path", uploadPathdef);
String value = uploadPath + OCFile.PATH_SEPARATOR + (fileName == null ? "" : fileName);
return value;
}
return file;
}
-}
\ No newline at end of file
+}
+++ /dev/null
-package com.owncloud.android.utils;
-
-import java.io.BufferedWriter;
-import java.io.File;
-import java.io.FileWriter;
-import java.io.IOException;
-import java.text.SimpleDateFormat;
-import java.util.Date;
-import java.util.Locale;
-
-import com.owncloud.android.MainApp;
-
-import android.util.Log;
-
-
-
-public class Log_OC {
-
-
- private static boolean isEnabled = false;
- private static File logFile;
- private static File folder;
- private static BufferedWriter buf;
-
- public static void i(String TAG, String message){
- // Printing the message to LogCat console
- int a = Log.i(TAG, message);
- // Write the log message to the file
- appendLog(TAG+" : "+message);
- }
-
- public static void d(String TAG, String message){
- Log.d(TAG, message);
- appendLog(TAG + " : " + message);
- }
- public static void d(String TAG, String message, Exception e) {
- Log.d(TAG, message, e);
- appendLog(TAG + " : " + message + " Exception : "+ e.getStackTrace());
- }
- public static void e(String TAG, String message){
- Log.e(TAG, message);
- appendLog(TAG + " : " + message);
- }
-
- public static void e(String TAG, String message, Throwable e) {
- Log.e(TAG, message, e);
- appendLog(TAG+" : " + message +" Exception : " + e.getStackTrace());
- }
-
- public static void v(String TAG, String message){
- Log.v(TAG, message);
- appendLog(TAG+" : "+ message);
- }
-
- public static void w(String TAG, String message) {
- Log.w(TAG,message);
- appendLog(TAG+" : "+ message);
- }
-
- public static void wtf(String TAG, String message) {
- Log.wtf(TAG,message);
- appendLog(TAG+" : "+ message);
- }
-
- public static void startLogging(String logPath) {
- folder = new File(logPath);
- logFile = new File(folder + File.separator + "log.txt");
-
- if (!folder.exists()) {
- folder.mkdirs();
- }
- if (logFile.exists()) {
- logFile.delete();
- }
- try {
- logFile.createNewFile();
- buf = new BufferedWriter(new FileWriter(logFile, true));
- isEnabled = true;
- appendPhoneInfo();
- }catch (IOException e){
- e.printStackTrace();
- }
- }
-
- public static void stopLogging() {
- SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMdd_HHmmss", Locale.getDefault());
- String currentDateandTime = sdf.format(new Date());
- if (logFile != null) {
- logFile.renameTo(new File(folder + File.separator + MainApp.getLogName() + currentDateandTime+".log"));
-
- isEnabled = false;
- try {
- buf.close();
- } catch (IOException e) {
- e.printStackTrace();
- }
-
- }
-
- }
-
- private static void appendPhoneInfo() {
- appendLog("Model : " + android.os.Build.MODEL);
- appendLog("Brand : " + android.os.Build.BRAND);
- appendLog("Product : " + android.os.Build.PRODUCT);
- appendLog("Device : " + android.os.Build.DEVICE);
- appendLog("Version-Codename : " + android.os.Build.VERSION.CODENAME);
- appendLog("Version-Release : " + android.os.Build.VERSION.RELEASE);
- }
-
- private static void appendLog(String text) {
- if (isEnabled) {
- try {
- buf.append(text);
- buf.newLine();
- } catch (IOException e) {
- e.printStackTrace();
- }
- }
-}
-
-
-
-
-
-
-
-
-}
--- /dev/null
+/*
+ * TouchImageView.java
+ * By: Michael Ortiz
+ * Updated By: Patrick Lackemacher
+ * Updated By: Babay88
+ * Updated By: @ipsilondev
+ * Updated By: hank-cp
+ * Updated By: singpolyma
+ * -------------------
+ * Extends Android ImageView to include pinch zooming, panning, fling and double tap zoom.
+ */
+
+package com.owncloud.android.utils;
+
+import com.owncloud.android.ui.preview.ImageViewCustom;
+
+import android.annotation.TargetApi;
+import android.content.Context;
+import android.content.res.Configuration;
+import android.graphics.Bitmap;
+import android.graphics.Canvas;
+import android.graphics.Matrix;
+import android.graphics.PointF;
+import android.graphics.RectF;
+import android.graphics.drawable.Drawable;
+import android.net.Uri;
+import android.os.Build;
+import android.os.Build.VERSION;
+import android.os.Build.VERSION_CODES;
+import android.os.Bundle;
+import android.os.Parcelable;
+import android.util.AttributeSet;
+import android.util.Log;
+import android.view.GestureDetector;
+import android.view.MotionEvent;
+import android.view.ScaleGestureDetector;
+import android.view.View;
+import android.view.animation.AccelerateDecelerateInterpolator;
+import android.widget.OverScroller;
+import android.widget.Scroller;
+
+public class TouchImageViewCustom extends ImageViewCustom {
+ private static final String DEBUG = "DEBUG";
+
+ //
+ // SuperMin and SuperMax multipliers. Determine how much the image can be
+ // zoomed below or above the zoom boundaries, before animating back to the
+ // min/max zoom boundary.
+ //
+ private static final float SUPER_MIN_MULTIPLIER = .75f;
+ private static final float SUPER_MAX_MULTIPLIER = 1.25f;
+
+ //
+ // Scale of image ranges from minScale to maxScale, where minScale == 1
+ // when the image is stretched to fit view.
+ //
+ private float normalizedScale;
+
+ //
+ // Matrix applied to image. MSCALE_X and MSCALE_Y should always be equal.
+ // MTRANS_X and MTRANS_Y are the other values used. prevMatrix is the matrix
+ // saved prior to the screen rotating.
+ //
+ private Matrix matrix, prevMatrix;
+
+ private static enum State { NONE, DRAG, ZOOM, FLING, ANIMATE_ZOOM };
+ private State state;
+
+ private float minScale;
+ private float maxScale;
+ private float superMinScale;
+ private float superMaxScale;
+ private float[] m;
+
+ private Context context;
+ private Fling fling;
+
+ private ScaleType mScaleType;
+
+ private boolean imageRenderedAtLeastOnce;
+ private boolean onDrawReady;
+
+ private ZoomVariables delayedZoomVariables;
+
+ //
+ // Size of view and previous view size (ie before rotation)
+ //
+ private int viewWidth, viewHeight, prevViewWidth, prevViewHeight;
+
+ //
+ // Size of image when it is stretched to fit view. Before and After rotation.
+ //
+ private float matchViewWidth, matchViewHeight, prevMatchViewWidth, prevMatchViewHeight;
+
+ private ScaleGestureDetector mScaleDetector;
+ private GestureDetector mGestureDetector;
+ private GestureDetector.OnDoubleTapListener doubleTapListener = null;
+ private OnTouchListener userTouchListener = null;
+ private OnTouchImageViewListener touchImageViewListener = null;
+
+ public TouchImageViewCustom(Context context) {
+ super(context);
+ sharedConstructing(context);
+ }
+
+ public TouchImageViewCustom(Context context, AttributeSet attrs) {
+ super(context, attrs);
+ sharedConstructing(context);
+ }
+
+ public TouchImageViewCustom(Context context, AttributeSet attrs, int defStyle) {
+ super(context, attrs, defStyle);
+ sharedConstructing(context);
+ }
+
+ private void sharedConstructing(Context context) {
+ super.setClickable(true);
+ this.context = context;
+ mScaleDetector = new ScaleGestureDetector(context, new ScaleListener());
+ mGestureDetector = new GestureDetector(context, new GestureListener());
+ matrix = new Matrix();
+ prevMatrix = new Matrix();
+ m = new float[9];
+ normalizedScale = 1;
+ if (mScaleType == null) {
+ mScaleType = ScaleType.FIT_CENTER;
+ }
+ minScale = 1;
+ maxScale = 3;
+ superMinScale = SUPER_MIN_MULTIPLIER * minScale;
+ superMaxScale = SUPER_MAX_MULTIPLIER * maxScale;
+ setImageMatrix(matrix);
+ setScaleType(ScaleType.MATRIX);
+ setState(State.NONE);
+ onDrawReady = false;
+ super.setOnTouchListener(new PrivateOnTouchListener());
+ }
+
+ @Override
+ public void setOnTouchListener(View.OnTouchListener l) {
+ userTouchListener = l;
+ }
+
+ public void setOnTouchImageViewListener(OnTouchImageViewListener l) {
+ touchImageViewListener = l;
+ }
+
+ public void setOnDoubleTapListener(GestureDetector.OnDoubleTapListener l) {
+ doubleTapListener = l;
+ }
+
+ @Override
+ public void setImageResource(int resId) {
+ super.setImageResource(resId);
+ savePreviousImageValues();
+ fitImageToView();
+ }
+
+ @Override
+ public void setImageBitmap(Bitmap bm) {
+ super.setImageBitmap(bm);
+ savePreviousImageValues();
+ fitImageToView();
+ }
+
+ @Override
+ public void setImageDrawable(Drawable drawable) {
+ super.setImageDrawable(drawable);
+ savePreviousImageValues();
+ fitImageToView();
+ }
+
+ @Override
+ public void setImageURI(Uri uri) {
+ super.setImageURI(uri);
+ savePreviousImageValues();
+ fitImageToView();
+ }
+
+ @Override
+ public void setScaleType(ScaleType type) {
+ if (type == ScaleType.FIT_START || type == ScaleType.FIT_END) {
+ throw new UnsupportedOperationException("TouchImageView does not support FIT_START or FIT_END");
+ }
+ if (type == ScaleType.MATRIX) {
+ super.setScaleType(ScaleType.MATRIX);
+
+ } else {
+ mScaleType = type;
+ if (onDrawReady) {
+ //
+ // If the image is already rendered, scaleType has been called programmatically
+ // and the TouchImageView should be updated with the new scaleType.
+ //
+ setZoom(this);
+ }
+ }
+ }
+
+ @Override
+ public ScaleType getScaleType() {
+ return mScaleType;
+ }
+
+ /**
+ * Returns false if image is in initial, unzoomed state. False, otherwise.
+ * @return true if image is zoomed
+ */
+ public boolean isZoomed() {
+ return normalizedScale != 1;
+ }
+
+ /**
+ * Return a Rect representing the zoomed image.
+ * @return rect representing zoomed image
+ */
+ public RectF getZoomedRect() {
+ if (mScaleType == ScaleType.FIT_XY) {
+ throw new UnsupportedOperationException("getZoomedRect() not supported with FIT_XY");
+ }
+ PointF topLeft = transformCoordTouchToBitmap(0, 0, true);
+ PointF bottomRight = transformCoordTouchToBitmap(viewWidth, viewHeight, true);
+
+ float w = getDrawable().getIntrinsicWidth();
+ float h = getDrawable().getIntrinsicHeight();
+ return new RectF(topLeft.x / w, topLeft.y / h, bottomRight.x / w, bottomRight.y / h);
+ }
+
+ /**
+ * Save the current matrix and view dimensions
+ * in the prevMatrix and prevView variables.
+ */
+ private void savePreviousImageValues() {
+ if (matrix != null && viewHeight != 0 && viewWidth != 0) {
+ matrix.getValues(m);
+ prevMatrix.setValues(m);
+ prevMatchViewHeight = matchViewHeight;
+ prevMatchViewWidth = matchViewWidth;
+ prevViewHeight = viewHeight;
+ prevViewWidth = viewWidth;
+ }
+ }
+
+ @Override
+ public Parcelable onSaveInstanceState() {
+ Bundle bundle = new Bundle();
+ bundle.putParcelable("instanceState", super.onSaveInstanceState());
+ bundle.putFloat("saveScale", normalizedScale);
+ bundle.putFloat("matchViewHeight", matchViewHeight);
+ bundle.putFloat("matchViewWidth", matchViewWidth);
+ bundle.putInt("viewWidth", viewWidth);
+ bundle.putInt("viewHeight", viewHeight);
+ matrix.getValues(m);
+ bundle.putFloatArray("matrix", m);
+ bundle.putBoolean("imageRendered", imageRenderedAtLeastOnce);
+ return bundle;
+ }
+
+ @Override
+ public void onRestoreInstanceState(Parcelable state) {
+ if (state instanceof Bundle) {
+ Bundle bundle = (Bundle) state;
+ normalizedScale = bundle.getFloat("saveScale");
+ m = bundle.getFloatArray("matrix");
+ prevMatrix.setValues(m);
+ prevMatchViewHeight = bundle.getFloat("matchViewHeight");
+ prevMatchViewWidth = bundle.getFloat("matchViewWidth");
+ prevViewHeight = bundle.getInt("viewHeight");
+ prevViewWidth = bundle.getInt("viewWidth");
+ imageRenderedAtLeastOnce = bundle.getBoolean("imageRendered");
+ super.onRestoreInstanceState(bundle.getParcelable("instanceState"));
+ return;
+ }
+
+ super.onRestoreInstanceState(state);
+ }
+
+ @Override
+ protected void onDraw(Canvas canvas) {
+ onDrawReady = true;
+ imageRenderedAtLeastOnce = true;
+ if (delayedZoomVariables != null) {
+ setZoom(delayedZoomVariables.scale, delayedZoomVariables.focusX, delayedZoomVariables.focusY, delayedZoomVariables.scaleType);
+ delayedZoomVariables = null;
+ }
+ super.onDraw(canvas);
+ }
+
+ @Override
+ public void onConfigurationChanged(Configuration newConfig) {
+ super.onConfigurationChanged(newConfig);
+ savePreviousImageValues();
+ }
+
+ /**
+ * Get the max zoom multiplier.
+ * @return max zoom multiplier.
+ */
+ public float getMaxZoom() {
+ return maxScale;
+ }
+
+ /**
+ * Set the max zoom multiplier. Default value: 3.
+ * @param max max zoom multiplier.
+ */
+ public void setMaxZoom(float max) {
+ maxScale = max;
+ superMaxScale = SUPER_MAX_MULTIPLIER * maxScale;
+ }
+
+ /**
+ * Get the min zoom multiplier.
+ * @return min zoom multiplier.
+ */
+ public float getMinZoom() {
+ return minScale;
+ }
+
+ /**
+ * Get the current zoom. This is the zoom relative to the initial
+ * scale, not the original resource.
+ * @return current zoom multiplier.
+ */
+ public float getCurrentZoom() {
+ return normalizedScale;
+ }
+
+ /**
+ * Set the min zoom multiplier. Default value: 1.
+ * @param min min zoom multiplier.
+ */
+ public void setMinZoom(float min) {
+ minScale = min;
+ superMinScale = SUPER_MIN_MULTIPLIER * minScale;
+ }
+
+ /**
+ * Reset zoom and translation to initial state.
+ */
+ public void resetZoom() {
+ normalizedScale = 1;
+ fitImageToView();
+ }
+
+ /**
+ * Set zoom to the specified scale. Image will be centered by default.
+ * @param scale
+ */
+ public void setZoom(float scale) {
+ setZoom(scale, 0.5f, 0.5f);
+ }
+
+ /**
+ * Set zoom to the specified scale. Image will be centered around the point
+ * (focusX, focusY). These floats range from 0 to 1 and denote the focus point
+ * as a fraction from the left and top of the view. For example, the top left
+ * corner of the image would be (0, 0). And the bottom right corner would be (1, 1).
+ * @param scale
+ * @param focusX
+ * @param focusY
+ */
+ public void setZoom(float scale, float focusX, float focusY) {
+ setZoom(scale, focusX, focusY, mScaleType);
+ }
+
+ /**
+ * Set zoom to the specified scale. Image will be centered around the point
+ * (focusX, focusY). These floats range from 0 to 1 and denote the focus point
+ * as a fraction from the left and top of the view. For example, the top left
+ * corner of the image would be (0, 0). And the bottom right corner would be (1, 1).
+ * @param scale
+ * @param focusX
+ * @param focusY
+ * @param scaleType
+ */
+ public void setZoom(float scale, float focusX, float focusY, ScaleType scaleType) {
+ //
+ // setZoom can be called before the image is on the screen, but at this point,
+ // image and view sizes have not yet been calculated in onMeasure. Thus, we should
+ // delay calling setZoom until the view has been measured.
+ //
+ if (!onDrawReady) {
+ delayedZoomVariables = new ZoomVariables(scale, focusX, focusY, scaleType);
+ return;
+ }
+
+ if (scaleType != mScaleType) {
+ setScaleType(scaleType);
+ }
+ resetZoom();
+ scaleImage(scale, viewWidth / 2, viewHeight / 2, true);
+ matrix.getValues(m);
+ m[Matrix.MTRANS_X] = -((focusX * getImageWidth()) - (viewWidth * 0.5f));
+ m[Matrix.MTRANS_Y] = -((focusY * getImageHeight()) - (viewHeight * 0.5f));
+ matrix.setValues(m);
+ fixTrans();
+ setImageMatrix(matrix);
+ }
+
+ /**
+ * Set zoom parameters equal to another TouchImageView. Including scale, position,
+ * and ScaleType.
+ * @param TouchImageView
+ */
+ public void setZoom(TouchImageViewCustom img) {
+ PointF center = img.getScrollPosition();
+ setZoom(img.getCurrentZoom(), center.x, center.y, img.getScaleType());
+ }
+
+ /**
+ * Return the point at the center of the zoomed image. The PointF coordinates range
+ * in value between 0 and 1 and the focus point is denoted as a fraction from the left
+ * and top of the view. For example, the top left corner of the image would be (0, 0).
+ * And the bottom right corner would be (1, 1).
+ * @return PointF representing the scroll position of the zoomed image.
+ */
+ public PointF getScrollPosition() {
+ Drawable drawable = getDrawable();
+ if (drawable == null) {
+ return null;
+ }
+ int drawableWidth = drawable.getIntrinsicWidth();
+ int drawableHeight = drawable.getIntrinsicHeight();
+
+ PointF point = transformCoordTouchToBitmap(viewWidth / 2, viewHeight / 2, true);
+ point.x /= drawableWidth;
+ point.y /= drawableHeight;
+ return point;
+ }
+
+ /**
+ * Set the focus point of the zoomed image. The focus points are denoted as a fraction from the
+ * left and top of the view. The focus points can range in value between 0 and 1.
+ * @param focusX
+ * @param focusY
+ */
+ public void setScrollPosition(float focusX, float focusY) {
+ setZoom(normalizedScale, focusX, focusY);
+ }
+
+ /**
+ * Performs boundary checking and fixes the image matrix if it
+ * is out of bounds.
+ */
+ private void fixTrans() {
+ matrix.getValues(m);
+ float transX = m[Matrix.MTRANS_X];
+ float transY = m[Matrix.MTRANS_Y];
+
+ float fixTransX = getFixTrans(transX, viewWidth, getImageWidth());
+ float fixTransY = getFixTrans(transY, viewHeight, getImageHeight());
+
+ if (fixTransX != 0 || fixTransY != 0) {
+ matrix.postTranslate(fixTransX, fixTransY);
+ }
+ }
+
+ /**
+ * When transitioning from zooming from focus to zoom from center (or vice versa)
+ * the image can become unaligned within the view. This is apparent when zooming
+ * quickly. When the content size is less than the view size, the content will often
+ * be centered incorrectly within the view. fixScaleTrans first calls fixTrans() and
+ * then makes sure the image is centered correctly within the view.
+ */
+ private void fixScaleTrans() {
+ fixTrans();
+ matrix.getValues(m);
+ if (getImageWidth() < viewWidth) {
+ m[Matrix.MTRANS_X] = (viewWidth - getImageWidth()) / 2;
+ }
+
+ if (getImageHeight() < viewHeight) {
+ m[Matrix.MTRANS_Y] = (viewHeight - getImageHeight()) / 2;
+ }
+ matrix.setValues(m);
+ }
+
+ private float getFixTrans(float trans, float viewSize, float contentSize) {
+ float minTrans, maxTrans;
+
+ if (contentSize <= viewSize) {
+ minTrans = 0;
+ maxTrans = viewSize - contentSize;
+
+ } else {
+ minTrans = viewSize - contentSize;
+ maxTrans = 0;
+ }
+
+ if (trans < minTrans)
+ return -trans + minTrans;
+ if (trans > maxTrans)
+ return -trans + maxTrans;
+ return 0;
+ }
+
+ private float getFixDragTrans(float delta, float viewSize, float contentSize) {
+ if (contentSize <= viewSize) {
+ return 0;
+ }
+ return delta;
+ }
+
+ private float getImageWidth() {
+ return matchViewWidth * normalizedScale;
+ }
+
+ private float getImageHeight() {
+ return matchViewHeight * normalizedScale;
+ }
+
+ @Override
+ protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
+ Drawable drawable = getDrawable();
+ if (drawable == null || drawable.getIntrinsicWidth() == 0 || drawable.getIntrinsicHeight() == 0) {
+ setMeasuredDimension(0, 0);
+ return;
+ }
+
+ int drawableWidth = drawable.getIntrinsicWidth();
+ int drawableHeight = drawable.getIntrinsicHeight();
+ int widthSize = MeasureSpec.getSize(widthMeasureSpec);
+ int widthMode = MeasureSpec.getMode(widthMeasureSpec);
+ int heightSize = MeasureSpec.getSize(heightMeasureSpec);
+ int heightMode = MeasureSpec.getMode(heightMeasureSpec);
+ viewWidth = setViewSize(widthMode, widthSize, drawableWidth);
+ viewHeight = setViewSize(heightMode, heightSize, drawableHeight);
+
+ //
+ // Set view dimensions
+ //
+ setMeasuredDimension(viewWidth, viewHeight);
+
+ //
+ // Fit content within view
+ //
+ fitImageToView();
+ }
+
+ /**
+ * If the normalizedScale is equal to 1, then the image is made to fit the screen. Otherwise,
+ * it is made to fit the screen according to the dimensions of the previous image matrix. This
+ * allows the image to maintain its zoom after rotation.
+ */
+ private void fitImageToView() {
+ Drawable drawable = getDrawable();
+ if (drawable == null || drawable.getIntrinsicWidth() == 0 || drawable.getIntrinsicHeight() == 0) {
+ return;
+ }
+ if (matrix == null || prevMatrix == null) {
+ return;
+ }
+
+ int drawableWidth = drawable.getIntrinsicWidth();
+ int drawableHeight = drawable.getIntrinsicHeight();
+
+ //
+ // Scale image for view
+ //
+ float scaleX = (float) viewWidth / drawableWidth;
+ float scaleY = (float) viewHeight / drawableHeight;
+
+ switch (mScaleType) {
+ case CENTER:
+ scaleX = scaleY = 1;
+ break;
+
+ case CENTER_CROP:
+ scaleX = scaleY = Math.max(scaleX, scaleY);
+ break;
+
+ case CENTER_INSIDE:
+ scaleX = scaleY = Math.min(1, Math.min(scaleX, scaleY));
+
+ case FIT_CENTER:
+ scaleX = scaleY = Math.min(scaleX, scaleY);
+ break;
+
+ case FIT_XY:
+ break;
+
+ default:
+ //
+ // FIT_START and FIT_END not supported
+ //
+ throw new UnsupportedOperationException("TouchImageView does not support FIT_START or FIT_END");
+
+ }
+
+ //
+ // Center the image
+ //
+ float redundantXSpace = viewWidth - (scaleX * drawableWidth);
+ float redundantYSpace = viewHeight - (scaleY * drawableHeight);
+ matchViewWidth = viewWidth - redundantXSpace;
+ matchViewHeight = viewHeight - redundantYSpace;
+ if (!isZoomed() && !imageRenderedAtLeastOnce) {
+ //
+ // Stretch and center image to fit view
+ //
+ matrix.setScale(scaleX, scaleY);
+ matrix.postTranslate(redundantXSpace / 2, redundantYSpace / 2);
+ normalizedScale = 1;
+
+ } else {
+ //
+ // These values should never be 0 or we will set viewWidth and viewHeight
+ // to NaN in translateMatrixAfterRotate. To avoid this, call savePreviousImageValues
+ // to set them equal to the current values.
+ //
+ if (prevMatchViewWidth == 0 || prevMatchViewHeight == 0) {
+ savePreviousImageValues();
+ }
+
+ prevMatrix.getValues(m);
+
+ //
+ // Rescale Matrix after rotation
+ //
+ m[Matrix.MSCALE_X] = matchViewWidth / drawableWidth * normalizedScale;
+ m[Matrix.MSCALE_Y] = matchViewHeight / drawableHeight * normalizedScale;
+
+ //
+ // TransX and TransY from previous matrix
+ //
+ float transX = m[Matrix.MTRANS_X];
+ float transY = m[Matrix.MTRANS_Y];
+
+ //
+ // Width
+ //
+ float prevActualWidth = prevMatchViewWidth * normalizedScale;
+ float actualWidth = getImageWidth();
+ translateMatrixAfterRotate(Matrix.MTRANS_X, transX, prevActualWidth, actualWidth, prevViewWidth, viewWidth, drawableWidth);
+
+ //
+ // Height
+ //
+ float prevActualHeight = prevMatchViewHeight * normalizedScale;
+ float actualHeight = getImageHeight();
+ translateMatrixAfterRotate(Matrix.MTRANS_Y, transY, prevActualHeight, actualHeight, prevViewHeight, viewHeight, drawableHeight);
+
+ //
+ // Set the matrix to the adjusted scale and translate values.
+ //
+ matrix.setValues(m);
+ }
+ fixTrans();
+ setImageMatrix(matrix);
+ }
+
+ /**
+ * Set view dimensions based on layout params
+ *
+ * @param mode
+ * @param size
+ * @param drawableWidth
+ * @return
+ */
+ private int setViewSize(int mode, int size, int drawableWidth) {
+ int viewSize;
+ switch (mode) {
+ case MeasureSpec.EXACTLY:
+ viewSize = size;
+ break;
+
+ case MeasureSpec.AT_MOST:
+ viewSize = Math.min(drawableWidth, size);
+ break;
+
+ case MeasureSpec.UNSPECIFIED:
+ viewSize = drawableWidth;
+ break;
+
+ default:
+ viewSize = size;
+ break;
+ }
+ return viewSize;
+ }
+
+ /**
+ * After rotating, the matrix needs to be translated. This function finds the area of image
+ * which was previously centered and adjusts translations so that is again the center, post-rotation.
+ *
+ * @param axis Matrix.MTRANS_X or Matrix.MTRANS_Y
+ * @param trans the value of trans in that axis before the rotation
+ * @param prevImageSize the width/height of the image before the rotation
+ * @param imageSize width/height of the image after rotation
+ * @param prevViewSize width/height of view before rotation
+ * @param viewSize width/height of view after rotation
+ * @param drawableSize width/height of drawable
+ */
+ private void translateMatrixAfterRotate(int axis, float trans, float prevImageSize, float imageSize, int prevViewSize, int viewSize, int drawableSize) {
+ if (imageSize < viewSize) {
+ //
+ // The width/height of image is less than the view's width/height. Center it.
+ //
+ m[axis] = (viewSize - (drawableSize * m[Matrix.MSCALE_X])) * 0.5f;
+
+ } else if (trans > 0) {
+ //
+ // The image is larger than the view, but was not before rotation. Center it.
+ //
+ m[axis] = -((imageSize - viewSize) * 0.5f);
+
+ } else {
+ //
+ // Find the area of the image which was previously centered in the view. Determine its distance
+ // from the left/top side of the view as a fraction of the entire image's width/height. Use that percentage
+ // to calculate the trans in the new view width/height.
+ //
+ float percentage = (Math.abs(trans) + (0.5f * prevViewSize)) / prevImageSize;
+ m[axis] = -((percentage * imageSize) - (viewSize * 0.5f));
+ }
+ }
+
+ private void setState(State state) {
+ this.state = state;
+ }
+
+ public boolean canScrollHorizontallyFroyo(int direction) {
+ return canScrollHorizontally(direction);
+ }
+
+ @Override
+ public boolean canScrollHorizontally(int direction) {
+ matrix.getValues(m);
+ float x = m[Matrix.MTRANS_X];
+
+ if (getImageWidth() < viewWidth) {
+ return false;
+
+ } else if (x >= -1 && direction < 0) {
+ return false;
+
+ } else if (Math.abs(x) + viewWidth + 1 >= getImageWidth() && direction > 0) {
+ return false;
+ }
+
+ return true;
+ }
+
+ /**
+ * Gesture Listener detects a single click or long click and passes that on
+ * to the view's listener.
+ * @author Ortiz
+ *
+ */
+ private class GestureListener extends GestureDetector.SimpleOnGestureListener {
+
+ @Override
+ public boolean onSingleTapConfirmed(MotionEvent e)
+ {
+ if(doubleTapListener != null) {
+ return doubleTapListener.onSingleTapConfirmed(e);
+ }
+ return performClick();
+ }
+
+ @Override
+ public void onLongPress(MotionEvent e)
+ {
+ performLongClick();
+ }
+
+ @Override
+ public boolean onFling(MotionEvent e1, MotionEvent e2, float velocityX, float velocityY)
+ {
+ if (fling != null) {
+ //
+ // If a previous fling is still active, it should be cancelled so that two flings
+ // are not run simultaenously.
+ //
+ fling.cancelFling();
+ }
+ fling = new Fling((int) velocityX, (int) velocityY);
+ compatPostOnAnimation(fling);
+ return super.onFling(e1, e2, velocityX, velocityY);
+ }
+
+ @Override
+ public boolean onDoubleTap(MotionEvent e) {
+ boolean consumed = false;
+ if(doubleTapListener != null) {
+ consumed = doubleTapListener.onDoubleTap(e);
+ }
+ if (state == State.NONE) {
+ float targetZoom = (normalizedScale == minScale) ? maxScale : minScale;
+ DoubleTapZoom doubleTap = new DoubleTapZoom(targetZoom, e.getX(), e.getY(), false);
+ compatPostOnAnimation(doubleTap);
+ consumed = true;
+ }
+ return consumed;
+ }
+
+ @Override
+ public boolean onDoubleTapEvent(MotionEvent e) {
+ if(doubleTapListener != null) {
+ return doubleTapListener.onDoubleTapEvent(e);
+ }
+ return false;
+ }
+ }
+
+ public interface OnTouchImageViewListener {
+ public void onMove();
+ }
+
+ /**
+ * Responsible for all touch events. Handles the heavy lifting of drag and also sends
+ * touch events to Scale Detector and Gesture Detector.
+ * @author Ortiz
+ *
+ */
+ private class PrivateOnTouchListener implements OnTouchListener {
+
+ //
+ // Remember last point position for dragging
+ //
+ private PointF last = new PointF();
+
+ @Override
+ public boolean onTouch(View v, MotionEvent event) {
+ mScaleDetector.onTouchEvent(event);
+ mGestureDetector.onTouchEvent(event);
+ PointF curr = new PointF(event.getX(), event.getY());
+
+ if (state == State.NONE || state == State.DRAG || state == State.FLING) {
+ switch (event.getAction()) {
+ case MotionEvent.ACTION_DOWN:
+ last.set(curr);
+ if (fling != null)
+ fling.cancelFling();
+ setState(State.DRAG);
+ break;
+
+ case MotionEvent.ACTION_MOVE:
+ if (state == State.DRAG) {
+ float deltaX = curr.x - last.x;
+ float deltaY = curr.y - last.y;
+ float fixTransX = getFixDragTrans(deltaX, viewWidth, getImageWidth());
+ float fixTransY = getFixDragTrans(deltaY, viewHeight, getImageHeight());
+ matrix.postTranslate(fixTransX, fixTransY);
+ fixTrans();
+ last.set(curr.x, curr.y);
+ }
+ break;
+
+ case MotionEvent.ACTION_UP:
+ case MotionEvent.ACTION_POINTER_UP:
+ setState(State.NONE);
+ break;
+ }
+ }
+
+ setImageMatrix(matrix);
+
+ //
+ // User-defined OnTouchListener
+ //
+ if(userTouchListener != null) {
+ userTouchListener.onTouch(v, event);
+ }
+
+ //
+ // OnTouchImageViewListener is set: TouchImageView dragged by user.
+ //
+ if (touchImageViewListener != null) {
+ touchImageViewListener.onMove();
+ }
+
+ //
+ // indicate event was handled
+ //
+ return true;
+ }
+ }
+
+ /**
+ * ScaleListener detects user two finger scaling and scales image.
+ * @author Ortiz
+ *
+ */
+ private class ScaleListener extends ScaleGestureDetector.SimpleOnScaleGestureListener {
+ @Override
+ public boolean onScaleBegin(ScaleGestureDetector detector) {
+ setState(State.ZOOM);
+ return true;
+ }
+
+ @Override
+ public boolean onScale(ScaleGestureDetector detector) {
+ scaleImage(detector.getScaleFactor(), detector.getFocusX(), detector.getFocusY(), true);
+
+ //
+ // OnTouchImageViewListener is set: TouchImageView pinch zoomed by user.
+ //
+ if (touchImageViewListener != null) {
+ touchImageViewListener.onMove();
+ }
+ return true;
+ }
+
+ @Override
+ public void onScaleEnd(ScaleGestureDetector detector) {
+ super.onScaleEnd(detector);
+ setState(State.NONE);
+ boolean animateToZoomBoundary = false;
+ float targetZoom = normalizedScale;
+ if (normalizedScale > maxScale) {
+ targetZoom = maxScale;
+ animateToZoomBoundary = true;
+
+ } else if (normalizedScale < minScale) {
+ targetZoom = minScale;
+ animateToZoomBoundary = true;
+ }
+
+ if (animateToZoomBoundary) {
+ DoubleTapZoom doubleTap = new DoubleTapZoom(targetZoom, viewWidth / 2, viewHeight / 2, true);
+ compatPostOnAnimation(doubleTap);
+ }
+ }
+ }
+
+ private void scaleImage(double deltaScale, float focusX, float focusY, boolean stretchImageToSuper) {
+
+ float lowerScale, upperScale;
+ if (stretchImageToSuper) {
+ lowerScale = superMinScale;
+ upperScale = superMaxScale;
+
+ } else {
+ lowerScale = minScale;
+ upperScale = maxScale;
+ }
+
+ float origScale = normalizedScale;
+ normalizedScale *= deltaScale;
+ if (normalizedScale > upperScale) {
+ normalizedScale = upperScale;
+ deltaScale = upperScale / origScale;
+ } else if (normalizedScale < lowerScale) {
+ normalizedScale = lowerScale;
+ deltaScale = lowerScale / origScale;
+ }
+
+ matrix.postScale((float) deltaScale, (float) deltaScale, focusX, focusY);
+ fixScaleTrans();
+ }
+
+ /**
+ * DoubleTapZoom calls a series of runnables which apply
+ * an animated zoom in/out graphic to the image.
+ * @author Ortiz
+ *
+ */
+ private class DoubleTapZoom implements Runnable {
+
+ private long startTime;
+ private static final float ZOOM_TIME = 500;
+ private float startZoom, targetZoom;
+ private float bitmapX, bitmapY;
+ private boolean stretchImageToSuper;
+ private AccelerateDecelerateInterpolator interpolator = new AccelerateDecelerateInterpolator();
+ private PointF startTouch;
+ private PointF endTouch;
+
+ DoubleTapZoom(float targetZoom, float focusX, float focusY, boolean stretchImageToSuper) {
+ setState(State.ANIMATE_ZOOM);
+ startTime = System.currentTimeMillis();
+ this.startZoom = normalizedScale;
+ this.targetZoom = targetZoom;
+ this.stretchImageToSuper = stretchImageToSuper;
+ PointF bitmapPoint = transformCoordTouchToBitmap(focusX, focusY, false);
+ this.bitmapX = bitmapPoint.x;
+ this.bitmapY = bitmapPoint.y;
+
+ //
+ // Used for translating image during scaling
+ //
+ startTouch = transformCoordBitmapToTouch(bitmapX, bitmapY);
+ endTouch = new PointF(viewWidth / 2, viewHeight / 2);
+ }
+
+ @Override
+ public void run() {
+ float t = interpolate();
+ double deltaScale = calculateDeltaScale(t);
+ scaleImage(deltaScale, bitmapX, bitmapY, stretchImageToSuper);
+ translateImageToCenterTouchPosition(t);
+ fixScaleTrans();
+ setImageMatrix(matrix);
+
+ //
+ // OnTouchImageViewListener is set: double tap runnable updates listener
+ // with every frame.
+ //
+ if (touchImageViewListener != null) {
+ touchImageViewListener.onMove();
+ }
+
+ if (t < 1f) {
+ //
+ // We haven't finished zooming
+ //
+ compatPostOnAnimation(this);
+
+ } else {
+ //
+ // Finished zooming
+ //
+ setState(State.NONE);
+ }
+ }
+
+ /**
+ * Interpolate between where the image should start and end in order to translate
+ * the image so that the point that is touched is what ends up centered at the end
+ * of the zoom.
+ * @param t
+ */
+ private void translateImageToCenterTouchPosition(float t) {
+ float targetX = startTouch.x + t * (endTouch.x - startTouch.x);
+ float targetY = startTouch.y + t * (endTouch.y - startTouch.y);
+ PointF curr = transformCoordBitmapToTouch(bitmapX, bitmapY);
+ matrix.postTranslate(targetX - curr.x, targetY - curr.y);
+ }
+
+ /**
+ * Use interpolator to get t
+ * @return
+ */
+ private float interpolate() {
+ long currTime = System.currentTimeMillis();
+ float elapsed = (currTime - startTime) / ZOOM_TIME;
+ elapsed = Math.min(1f, elapsed);
+ return interpolator.getInterpolation(elapsed);
+ }
+
+ /**
+ * Interpolate the current targeted zoom and get the delta
+ * from the current zoom.
+ * @param t
+ * @return
+ */
+ private double calculateDeltaScale(float t) {
+ double zoom = startZoom + t * (targetZoom - startZoom);
+ return zoom / normalizedScale;
+ }
+ }
+
+ /**
+ * This function will transform the coordinates in the touch event to the coordinate
+ * system of the drawable that the imageview contain
+ * @param x x-coordinate of touch event
+ * @param y y-coordinate of touch event
+ * @param clipToBitmap Touch event may occur within view, but outside image content. True, to clip return value
+ * to the bounds of the bitmap size.
+ * @return Coordinates of the point touched, in the coordinate system of the original drawable.
+ */
+ private PointF transformCoordTouchToBitmap(float x, float y, boolean clipToBitmap) {
+ matrix.getValues(m);
+ float origW = getDrawable().getIntrinsicWidth();
+ float origH = getDrawable().getIntrinsicHeight();
+ float transX = m[Matrix.MTRANS_X];
+ float transY = m[Matrix.MTRANS_Y];
+ float finalX = ((x - transX) * origW) / getImageWidth();
+ float finalY = ((y - transY) * origH) / getImageHeight();
+
+ if (clipToBitmap) {
+ finalX = Math.min(Math.max(finalX, 0), origW);
+ finalY = Math.min(Math.max(finalY, 0), origH);
+ }
+
+ return new PointF(finalX , finalY);
+ }
+
+ /**
+ * Inverse of transformCoordTouchToBitmap. This function will transform the coordinates in the
+ * drawable's coordinate system to the view's coordinate system.
+ * @param bx x-coordinate in original bitmap coordinate system
+ * @param by y-coordinate in original bitmap coordinate system
+ * @return Coordinates of the point in the view's coordinate system.
+ */
+ private PointF transformCoordBitmapToTouch(float bx, float by) {
+ matrix.getValues(m);
+ float origW = getDrawable().getIntrinsicWidth();
+ float origH = getDrawable().getIntrinsicHeight();
+ float px = bx / origW;
+ float py = by / origH;
+ float finalX = m[Matrix.MTRANS_X] + getImageWidth() * px;
+ float finalY = m[Matrix.MTRANS_Y] + getImageHeight() * py;
+ return new PointF(finalX , finalY);
+ }
+
+ /**
+ * Fling launches sequential runnables which apply
+ * the fling graphic to the image. The values for the translation
+ * are interpolated by the Scroller.
+ * @author Ortiz
+ *
+ */
+ private class Fling implements Runnable {
+
+ CompatScroller scroller;
+ int currX, currY;
+
+ Fling(int velocityX, int velocityY) {
+ setState(State.FLING);
+ scroller = new CompatScroller(context);
+ matrix.getValues(m);
+
+ int startX = (int) m[Matrix.MTRANS_X];
+ int startY = (int) m[Matrix.MTRANS_Y];
+ int minX, maxX, minY, maxY;
+
+ if (getImageWidth() > viewWidth) {
+ minX = viewWidth - (int) getImageWidth();
+ maxX = 0;
+
+ } else {
+ minX = maxX = startX;
+ }
+
+ if (getImageHeight() > viewHeight) {
+ minY = viewHeight - (int) getImageHeight();
+ maxY = 0;
+
+ } else {
+ minY = maxY = startY;
+ }
+
+ scroller.fling(startX, startY, (int) velocityX, (int) velocityY, minX,
+ maxX, minY, maxY);
+ currX = startX;
+ currY = startY;
+ }
+
+ public void cancelFling() {
+ if (scroller != null) {
+ setState(State.NONE);
+ scroller.forceFinished(true);
+ }
+ }
+
+ @Override
+ public void run() {
+
+ //
+ // OnTouchImageViewListener is set: TouchImageView listener has been flung by user.
+ // Listener runnable updated with each frame of fling animation.
+ //
+ if (touchImageViewListener != null) {
+ touchImageViewListener.onMove();
+ }
+
+ if (scroller.isFinished()) {
+ scroller = null;
+ return;
+ }
+
+ if (scroller.computeScrollOffset()) {
+ int newX = scroller.getCurrX();
+ int newY = scroller.getCurrY();
+ int transX = newX - currX;
+ int transY = newY - currY;
+ currX = newX;
+ currY = newY;
+ matrix.postTranslate(transX, transY);
+ fixTrans();
+ setImageMatrix(matrix);
+ compatPostOnAnimation(this);
+ }
+ }
+ }
+
+ @TargetApi(Build.VERSION_CODES.GINGERBREAD)
+ private class CompatScroller {
+ Scroller scroller;
+ OverScroller overScroller;
+ boolean isPreGingerbread;
+
+ public CompatScroller(Context context) {
+ if (VERSION.SDK_INT < VERSION_CODES.GINGERBREAD) {
+ isPreGingerbread = true;
+ scroller = new Scroller(context);
+
+ } else {
+ isPreGingerbread = false;
+ overScroller = new OverScroller(context);
+ }
+ }
+
+ public void fling(int startX, int startY, int velocityX, int velocityY, int minX, int maxX, int minY, int maxY) {
+ if (isPreGingerbread) {
+ scroller.fling(startX, startY, velocityX, velocityY, minX, maxX, minY, maxY);
+ } else {
+ overScroller.fling(startX, startY, velocityX, velocityY, minX, maxX, minY, maxY);
+ }
+ }
+
+ public void forceFinished(boolean finished) {
+ if (isPreGingerbread) {
+ scroller.forceFinished(finished);
+ } else {
+ overScroller.forceFinished(finished);
+ }
+ }
+
+ public boolean isFinished() {
+ if (isPreGingerbread) {
+ return scroller.isFinished();
+ } else {
+ return overScroller.isFinished();
+ }
+ }
+
+ public boolean computeScrollOffset() {
+ if (isPreGingerbread) {
+ return scroller.computeScrollOffset();
+ } else {
+ overScroller.computeScrollOffset();
+ return overScroller.computeScrollOffset();
+ }
+ }
+
+ public int getCurrX() {
+ if (isPreGingerbread) {
+ return scroller.getCurrX();
+ } else {
+ return overScroller.getCurrX();
+ }
+ }
+
+ public int getCurrY() {
+ if (isPreGingerbread) {
+ return scroller.getCurrY();
+ } else {
+ return overScroller.getCurrY();
+ }
+ }
+ }
+
+ @TargetApi(Build.VERSION_CODES.JELLY_BEAN)
+ private void compatPostOnAnimation(Runnable runnable) {
+ if (VERSION.SDK_INT >= VERSION_CODES.JELLY_BEAN) {
+ postOnAnimation(runnable);
+
+ } else {
+ postDelayed(runnable, 1000/60);
+ }
+ }
+
+ private class ZoomVariables {
+ public float scale;
+ public float focusX;
+ public float focusY;
+ public ScaleType scaleType;
+
+ public ZoomVariables(float scale, float focusX, float focusY, ScaleType scaleType) {
+ this.scale = scale;
+ this.focusX = focusX;
+ this.focusY = focusY;
+ this.scaleType = scaleType;
+ }
+ }
+
+ private void printMatrixInfo() {
+ float[] n = new float[9];
+ matrix.getValues(n);
+ Log.d(DEBUG, "Scale: " + n[Matrix.MSCALE_X] + " TransX: " + n[Matrix.MTRANS_X] + " TransY: " + n[Matrix.MTRANS_Y]);
+ }
+}
\ No newline at end of file