<!--
ownCloud Android client application
- Copyright (C) 2012-2013 ownCloud Inc.
+ Copyright (C) 2015 ownCloud Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License version 2,
/* ownCloud Jelly Bean Workaround for lost credentials
- * Copyright (C) 2013 ownCloud Inc.
+ * Copyright (C) 2015 ownCloud Inc.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2,
ownCloud Android client application
Copyright (C) 2012 Bartek Przybylski
- Copyright (C) 2012-2013 ownCloud Inc.
+ Copyright (C) 2015 ownCloud Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License version 2,
ownCloud Android client application
Copyright (C) 2012 Bartek Przybylski
- Copyright (C) 2012-2013 ownCloud Inc.
+ Copyright (C) 2015 ownCloud Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License version 2,
ownCloud Android client application
Copyright (C) 2012 Bartek Przybylski
- Copyright (C) 2012-2013 ownCloud Inc.
+ Copyright (C) 2015 ownCloud Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License version 2,
ownCloud Android client application\r
\r
Copyright (C) 2012 Bartek Przybylski\r
- Copyright (C) 2012-2013 ownCloud Inc.\r
+ Copyright (C) 2015 ownCloud Inc.\r
\r
This program is free software: you can redistribute it and/or modify\r
it under the terms of the GNU General Public License version 2,\r
ownCloud Android client application
Copyright (C) 2012 Bartek Przybylski
- Copyright (C) 2012-2013 ownCloud Inc.
+ Copyright (C) 2015 ownCloud Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License version 2,
ownCloud Android client application
Copyright (C) 2012 Bartek Przybylski
- Copyright (C) 2012-2013 ownCloud Inc.
+ Copyright (C) 2015 ownCloud Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License version 2,
ownCloud Android client application\r
\r
Copyright (C) 2012 Bartek Przybylski\r
- Copyright (C) 2012-2013 ownCloud Inc.\r
+ Copyright (C) 2015 ownCloud Inc.\r
\r
This program is free software: you can redistribute it and/or modify\r
it under the terms of the GNU General Public License version 2,\r
ownCloud Android client application
Copyright (C) 2012 Bartek Przybylski
- Copyright (C) 2012-2013 ownCloud Inc.
+ Copyright (C) 2015 ownCloud Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License version 2,
ownCloud Android client application
Copyright (C) 2012 Bartek Przybylski
- Copyright (C) 2012-2013 ownCloud Inc.
+ Copyright (C) 2015 ownCloud Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License version 2,
ownCloud Android client application
Copyright (C) 2012 Bartek Przybylski
- Copyright (C) 2012-2013 ownCloud Inc.
+ Copyright (C) 2015 ownCloud Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License version 2,
ownCloud Android client application\r
\r
Copyright (C) 2012 Bartek Przybylski\r
- Copyright (C) 2012-2013 ownCloud Inc.\r
+ Copyright (C) 2015 ownCloud Inc.\r
\r
This program is free software: you can redistribute it and/or modify\r
it under the terms of the GNU General Public License version 2,\r
ownCloud Android client application
Copyright (C) 2012 Bartek Przybylski
- Copyright (C) 2012-2013 ownCloud Inc.
+ Copyright (C) 2015 ownCloud Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License version 2,
ownCloud Android client application
Copyright (C) 2012 Bartek Przybylski
- Copyright (C) 2012-2013 ownCloud Inc.
+ Copyright (C) 2015 ownCloud Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License version 2,
ownCloud Android client application\r
\r
Copyright (C) 2012 Bartek Przybylski\r
- Copyright (C) 2012-2013 ownCloud Inc.\r
+ Copyright (C) 2015 ownCloud Inc.\r
\r
This program is free software: you can redistribute it and/or modify\r
it under the terms of the GNU General Public License version 2,\r
ownCloud Android client application
Copyright (C) 2012 Bartek Przybylski
- Copyright (C) 2012-2013 ownCloud Inc.
+ Copyright (C) 2015 ownCloud Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License version 2,
ownCloud Android client application\r
\r
Copyright (C) 2012 Bartek Przybylski\r
- Copyright (C) 2012-2013 ownCloud Inc.\r
+ Copyright (C) 2015 ownCloud Inc.\r
\r
This program is free software: you can redistribute it and/or modify\r
it under the terms of the GNU General Public License version 2,\r
ownCloud Android client application
Copyright (C) 2012 Bartek Przybylski
- Copyright (C) 2012-2013 ownCloud Inc.
+ Copyright (C) 2015 ownCloud Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License version 2,
ownCloud Android client application
Copyright (C) 2012 Bartek Przybylski
- Copyright (C) 2012-2013 ownCloud Inc.
+ Copyright (C) 2015 ownCloud Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License version 2,
ownCloud Android client application
Copyright (C) 2012 Bartek Przybylski
- Copyright (C) 2012-2013 ownCloud Inc.
+ Copyright (C) 2015 ownCloud Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License version 2,
ownCloud Android client application
Copyright (C) 2012 Bartek Przybylski
- Copyright (C) 2012-2013 ownCloud Inc.
+ Copyright (C) 2015 ownCloud Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License version 2,
ownCloud Android client application
Copyright (C) 2012 Bartek Przybylski
- Copyright (C) 2012-2013 ownCloud Inc.
+ Copyright (C) 2015 ownCloud Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License version 2,
ownCloud Android client application
Copyright (C) 2012 Bartek Przybylski
- Copyright (C) 2012-2013 ownCloud Inc.
+ Copyright (C) 2015 ownCloud Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License version 2,
ownCloud Android client application
Copyright (C) 2012 Bartek Przybylski
- Copyright (C) 2012-2013 ownCloud Inc.
+ Copyright (C) 2015 ownCloud Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License version 2,
ownCloud Android client application
Copyright (C) 2012 Bartek Przybylski
- Copyright (C) 2012-2013 ownCloud Inc.
+ Copyright (C) 2015 ownCloud Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License version 2,
ownCloud Android client application\r
\r
Copyright (C) 2012 Bartek Przybylski\r
- Copyright (C) 2012-2013 ownCloud Inc.\r
+ Copyright (C) 2015 ownCloud Inc.\r
\r
This program is free software: you can redistribute it and/or modify\r
it under the terms of the GNU General Public License version 2,\r
<!--
ownCloud Android client application
- Copyright (C) 2012-2014 ownCloud Inc.
+ Copyright (C) 2015 ownCloud Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License version 2,
<?xml version="1.0" encoding="utf-8"?>
<!--
ownCloud Android client application
- Copyright (C) 2014 ownCloud Inc.
+ Copyright (C) 2015 ownCloud Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License version 2,
<!--
ownCloud Android client application
- Copyright (C) 2012-2013 ownCloud Inc.
+ Copyright (C) 2015 ownCloud Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License version 2,
ownCloud Android client application\r
\r
Copyright (C) 2012 Bartek Przybylski\r
- Copyright (C) 2012-2013 ownCloud Inc.\r
+ Copyright (C) 2015 ownCloud Inc.\r
\r
This program is free software: you can redistribute it and/or modify\r
it under the terms of the GNU General Public License version 2,\r
ownCloud Android client application\r
\r
Copyright (C) 2012 Bartek Przybylski\r
- Copyright (C) 2012-2013 ownCloud Inc.\r
+ Copyright (C) 2015 ownCloud Inc.\r
\r
This program is free software: you can redistribute it and/or modify\r
it under the terms of the GNU General Public License version 2,\r
<!--
ownCloud Android client application
- Copyright (C) 2012-2014 ownCloud Inc.
+ Copyright (C) 2015 ownCloud Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License version 2,
ownCloud Android client application
Copyright (C) 2012 Bartek Przybylski
- Copyright (C) 2012-2013 ownCloud Inc.
+ Copyright (C) 2015 ownCloud Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License version 2,
ownCloud Android client application
Copyright (C) 2012 Bartek Przybylski
- Copyright (C) 2012-2013 ownCloud Inc.
+ Copyright (C) 2015 ownCloud Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License version 2,
ownCloud Android client application
Copyright (C) 2012 Bartek Przybylski
- Copyright (C) 2012-2013 ownCloud Inc.
+ Copyright (C) 2015 ownCloud Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License version 2,
<!--
ownCloud Android client application
- Copyright (C) 2012-2013 ownCloud Inc.
+ Copyright (C) 2015 ownCloud Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License version 2,
as published by the Free Software Foundation.
<!--
ownCloud Android client application
- Copyright (C) 2012-2013 ownCloud Inc.
+ Copyright (C) 2015 ownCloud Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License version 2,
ownCloud Android client application\r
\r
Copyright (C) 2012 Bartek Przybylski\r
- Copyright (C) 2012-2013 ownCloud Inc.\r
+ Copyright (C) 2015 ownCloud Inc.\r
\r
This program is free software: you can redistribute it and/or modify\r
it under the terms of the GNU General Public License version 2,\r
<?xml version="1.0" encoding="utf-8"?>
+ <!--
+ ownCloud Android client application
+
+ Copyright (C) 2015 ownCloud Inc.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License version 2,
+ as published by the Free Software Foundation.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
+-->
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
<!--
ownCloud Android client application
- Copyright (C) 2012-2013 ownCloud Inc.
+ Copyright (C) 2015 ownCloud Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License version 2,
<?xml version="1.0" encoding="UTF-8"?>\r
<!--\r
ownCloud Android client application\r
- Copyright (C) 2014 ownCloud Inc.\r
+ Copyright (C) 2015 ownCloud Inc.\r
\r
This program is free software: you can redistribute it and/or modify\r
it under the terms of the GNU General Public License version 2,\r
<?xml version="1.0" encoding="UTF-8"?>\r
<!--\r
ownCloud Android client application\r
- Copyright (C) 2014 ownCloud Inc.\r
+ Copyright (C) 2015 ownCloud Inc.\r
\r
This program is free software: you can redistribute it and/or modify\r
it under the terms of the GNU General Public License version 2,\r
ownCloud Android client application
Copyright (C) 2012 Bartek Przybylski
- Copyright (C) 2012-2015 ownCloud Inc.
+ Copyright (C) 2015 ownCloud Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License version 2,
ownCloud Android client application\r
\r
Copyright (C) 2012 Bartek Przybylski\r
- Copyright (C) 2012-2013 ownCloud Inc.\r
+ Copyright (C) 2015 ownCloud Inc.\r
\r
This program is free software: you can redistribute it and/or modify\r
it under the terms of the GNU General Public License version 2,\r
<?xml version="1.0" encoding="utf-8"?>
+<!--
+ ownCloud Android client application
+
+ Copyright (C) 2015 ownCloud Inc.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License version 2,
+ as published by the Free Software Foundation.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
+-->
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/loadingLayout"
android:layout_width="match_parent"
<?xml version="1.0" encoding="utf-8"?>
+<!--
+ ownCloud Android client application
+
+ Copyright (C) 2015 ownCloud Inc.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License version 2,
+ as published by the Free Software Foundation.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
+-->
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
<?xml version="1.0" encoding="utf-8"?>
+<!--
+ ownCloud Android client application
+
+ Copyright (C) 2015 ownCloud Inc.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License version 2,
+ as published by the Free Software Foundation.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
+-->
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
<!--
ownCloud Android client application
- Copyright (C) 2012-2013 ownCloud Inc.
+ Copyright (C) 2015 ownCloud Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License version 2,
<?xml version="1.0" encoding="utf-8"?>
<!--
ownCloud Android client application
- Copyright (C) 2014 ownCloud Inc.
+ Copyright (C) 2015 ownCloud Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License version 2,
ownCloud Android client application\r
\r
Copyright (C) 2012 Bartek Przybylski\r
- Copyright (C) 2012-2013 ownCloud Inc.\r
+ Copyright (C) 2015 ownCloud Inc.\r
\r
This program is free software: you can redistribute it and/or modify\r
it under the terms of the GNU General Public License version 2,\r
android:textColor="@android:color/black"\r
android:gravity="center_horizontal"\r
/>\r
-\r <TextView\r
+\r
+ <TextView\r
android:id="@+id/pinHdrExpl"\r
android:layout_width="wrap_content"\r
android:layout_height="wrap_content"\r
ownCloud Android client application\r
\r
Copyright (C) 2012 Bartek Przybylski\r
- Copyright (C) 2012-2013 ownCloud Inc.\r
+ Copyright (C) 2015 ownCloud Inc.\r
\r
This program is free software: you can redistribute it and/or modify\r
it under the terms of the GNU General Public License version 2,\r
<!--
ownCloud Android client application
- Copyright (C) 2012-2013 ownCloud Inc.
+ Copyright (C) 2015 ownCloud Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License version 2,
<!--
ownCloud Android client application
- Copyright (C) 2012-2013 ownCloud Inc.
+ Copyright (C) 2015 ownCloud Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License version 2,
android:layout_centerInParent="true"
/>
- <com.owncloud.android.utils.TouchImageViewCustom
+ <third_parties.michaelOrtiz.TouchImageViewCustom
android:id="@+id/image"
android:layout_width="match_parent"
android:layout_height="match_parent"
<!--
ownCloud Android client application
- Copyright (C) 2012-2013 ownCloud Inc.
+ Copyright (C) 2015 ownCloud Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License version 2,
<!--
ownCloud Android client application
- Copyright (C) 2012-2013 ownCloud Inc.
+ Copyright (C) 2015 ownCloud Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License version 2,
<!--
ownCloud Android client application
- Copyright (C) 2012-2013 ownCloud Inc.
+ Copyright (C) 2015 ownCloud Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License version 2,
<!-- \r
ownCloud Android client application\r
\r
- Copyright (C) 2012-2013 ownCloud Inc.\r
+ Copyright (C) 2015 ownCloud Inc.\r
\r
This program is free software: you can redistribute it and/or modify\r
it under the terms of the GNU General Public License version 2,\r
android:layout_height="fill_parent"\r
android:background="@color/background_color"\r
android:orientation="vertical" >\r
-
+\r
<fragment\r
android:id="@+id/local_files_list"\r
android:layout_width="match_parent"\r
android:layout_height="0dip"\r
android:layout_weight="1"\r
class="com.owncloud.android.ui.fragment.LocalFileListFragment" />\r
-
+\r
<LinearLayout\r
android:layout_width="match_parent"\r
android:layout_height="wrap_content"\r
android:gravity="center"\r
android:orientation="horizontal" >\r
-\r <Button\r
+\r
+ <Button\r
android:id="@+id/upload_files_btn_cancel"\r
android:layout_width="wrap_content"\r
android:layout_height="wrap_content"\r
android:layout_weight="1"\r
android:text="@string/common_cancel" />\r
-\r <Button\r
+\r
+ <Button\r
android:id="@+id/upload_files_btn_upload"\r
android:layout_width="wrap_content"\r
android:layout_height="wrap_content"\r
ownCloud Android client application
Copyright (C) 2012 Bartek Przybylski
- Copyright (C) 2012-2013 ownCloud Inc.
+ Copyright (C) 2015 ownCloud Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License version 2,
ownCloud Android client application
Copyright (C) 2012 Bartek Przybylski
- Copyright (C) 2012-2013 ownCloud Inc.
+ Copyright (C) 2015 ownCloud Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License version 2,
<?xml version="1.0" encoding="utf-8"?>
+<!--
+ ownCloud Android client application
+
+ Copyright (C) 2015 ownCloud Inc.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License version 2,
+ as published by the Free Software Foundation.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
+-->
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent" >
ownCloud Android client application
Copyright (C) 2012 Bartek Przybylski
- Copyright (C) 2012-2013 ownCloud Inc.
+ Copyright (C) 2015 ownCloud Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License version 2,
ownCloud Android client application
Copyright (C) 2012 Bartek Przybylski
- Copyright (C) 2012-2013 ownCloud Inc.
+ Copyright (C) 2015 ownCloud Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License version 2,
ownCloud Android client application
Copyright (C) 2012 Bartek Przybylski
- Copyright (C) 2012-2013 ownCloud Inc.
+ Copyright (C) 2015 ownCloud Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License version 2,
<!--
ownCloud Android client application
- Copyright (C) 2012-2013 ownCloud Inc.
+ Copyright (C) 2015 ownCloud Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License version 2,
-->
<body>
<p>
- Dieses Gerät läuft mit Android 4.1.x.
+ Dieses Ger�t l�uft mit Android 4.1.x.
</p>
<p>
- In dieser Version von Android existiert ein Bug, der nach jedem Neustart eine erneute Eingabe der ownCloud Login-Informationen nötig macht. Um das zu umgehen installieren Sie bitte diese kostenlose Hilfs-App:
+ In dieser Version von Android existiert ein Bug, der nach jedem Neustart eine erneute Eingabe der ownCloud Login-Informationen n�tig macht. Um das zu umgehen installieren Sie bitte diese kostenlose Hilfs-App:
</p>
<p style="text-align:center">
<a href="http://play.google.com/store/apps/details?id=com.owncloud.android.workaround.accounts">ownCloud Jelly Bean Workaround</a>
<!--
ownCloud Android client application
- Copyright (C) 2012-2013 ownCloud Inc.
+ Copyright (C) 2015 ownCloud Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License version 2,
Su dispositivo ejecuta Android 4.1.x.
</p>
<p>
- Para prevenir la pérdida de las credenciales de sus cuentas ownCloud en cada reinicio, por favor, instale esta app gratuita que evita el problema en Jelly Bean:
+ Para prevenir la p�rdida de las credenciales de sus cuentas ownCloud en cada reinicio, por favor, instale esta app gratuita que evita el problema en Jelly Bean:
</p>
<p style="text-align:center">
<a href="http://play.google.com/store/apps/details?id=com.owncloud.android.workaround.accounts">ownCloud Jelly Bean Workaround</a>
<!--
ownCloud Android client application
- Copyright (C) 2012-2013 ownCloud Inc.
+ Copyright (C) 2015 ownCloud Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License version 2,
<string name="auth_unsupported_multiaccount">%1$s nepodporuje více účtů</string>
<string name="auth_fail_get_user_name">Váš server nevrací správné přihlašovací ID, kontaktujte prosím svého správce systému</string>
<string name="auth_can_not_auth_against_server">Není možné provést ověření </string>
- <string name="auth_account_does_not_exist">Ještě není nastaven žádný účet v přístroji</string>
+ <string name="auth_account_does_not_exist">V zařízení není zatím nastaven účet</string>
<string name="fd_keep_in_sync">Udržovat soubor aktuální</string>
<string name="common_rename">Přejmenovat</string>
<string name="common_remove">Odstranit</string>
<string name="prefs_category_security">Zabezpečení</string>
<string name="prefs_instant_video_upload_path_title">Cesta pro nahrávání videí</string>
<string name="download_folder_failed_content">Stažení adresáře %1$s nemohlo být dokončeno</string>
- <string name="subject_token">%1$s sdílí \"%2$s\"</string>
+ <string name="subject_token">%1$s sdílí \"%2$s\" s vámi</string>
</resources>
<string name="auth_fail_get_user_name">Ο διακομιστής σας δεν επιστρέφει το σωστό αναγνωριστικό χρήστη, παρακαλώ επικοινωνήστε με ένα διαχειριστή
⇥</string>
<string name="auth_can_not_auth_against_server">Δεν είναι δυνατή η πιστοποίηση με αυτόν το διακομιστή</string>
+ <string name="auth_account_does_not_exist">Ο λογαριασμός δεν υπάρχει στη συσκευή ακόμα.</string>
<string name="fd_keep_in_sync">Διατήρηση αρχείου σε ενημέρωση</string>
<string name="common_rename">Μετονομασία</string>
<string name="common_remove">Αφαίρεση</string>
<!--
ownCloud Android client application
- Copyright (C) 2012-2013 ownCloud Inc.
+ Copyright (C) 2015 ownCloud Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License version 2,
<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_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="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_text">На вашем устройстве нет учётных записей %1$s. Пожалуйста, настройте учётную запись.</string>
<string name="uploader_wrn_no_account_setup_btn_text">Настройка</string>
<string name="uploader_wrn_no_account_quit_btn_text">Выход</string>
<string name="uploader_wrn_no_content_title">Нет содержимого для загрузки</string>
<?xml version='1.0' encoding='UTF-8'?>
<resources>
+ <string name="about_android">%1$s Андроид апликација</string>
+ <string name="about_version">верзија %1$s</string>
<string name="actionbar_sync">Освежи налог</string>
<string name="actionbar_upload">Отпреми</string>
- <string name="actionbar_upload_from_apps">Садржај са других апликација</string>
- <string name="actionbar_upload_files">Ð\94аÑ\82оÑ\82еке</string>
- <string name="actionbar_open_with">Отвори са</string>
+ <string name="actionbar_upload_from_apps">Садржај из других апликација</string>
+ <string name="actionbar_upload_files">ФаÑ\98лови</string>
+ <string name="actionbar_open_with">Отвори помоћу</string>
<string name="actionbar_mkdir">Нова фасцикла</string>
<string name="actionbar_settings">Поставке</string>
+ <string name="actionbar_see_details">Детаљи</string>
<string name="actionbar_send_file">Пошаљи</string>
+ <string name="actionbar_sort">Разврстај</string>
+ <string name="actionbar_sort_title">Разврставање</string>
+ <string-array name="actionbar_sortby">
+ <item>A-Z</item>
+ <item>новији - старији</item>
+ </string-array>
<!--TODO re-enable when server-side folder size calculation is available
<item>Biggest - Smallest</item>-->
<string name="prefs_category_general">Опште</string>
<string name="prefs_category_more">Више</string>
<string name="prefs_accounts">Налози</string>
+ <string name="prefs_manage_accounts">Управљање налозима</string>
+ <string name="prefs_pincode">ПИБ апликације</string>
+ <string name="prefs_pincode_summary">Заштитите програм</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_delete_history_button">Обриши Историју</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="prefs_remember_last_share_location">Упамти локацију дељења</string>
+ <string name="prefs_remember_last_upload_location_summary">Памти последњу локацију отпремања дељења</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="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_wrn_no_account_quit_btn_text">Ð\98заÑ\92и</string>
+ <string name="uploader_wrn_no_account_quit_btn_text">Ð\9dапÑ\83Ñ\81Ñ\82и</string>
<string name="uploader_wrn_no_content_title">Нема садржаја за отпремање</string>
- <string name="uploader_wrn_no_content_text">Садржај није примљен. Нема ништа да се отпреми.</string>
+ <string name="uploader_wrn_no_content_text">Садржај није примљен. Нема шта да се отпреми.</string>
<string name="uploader_info_uploading">Отпремање</string>
- <string name="file_list_seconds_ago">пÑ\80е неколико секунди</string>
+ <string name="file_list_seconds_ago">пÑ\80е паÑ\80 секунди</string>
<string name="file_list_empty">Овде нема ничег. Отпремите нешто!</string>
- <string name="filedetails_select_file">Додирните датотеку ради приказа додатних информација.</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_created">Направљен:</string>
+ <string name="filedetails_modified">Измењен:</string>
<string name="filedetails_download">Преузми</string>
- <string name="filedetails_sync_file">Освежи датотеку</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">У реду</string>
- <string name="common_cancel_download">Обустави преузимање</string>
- <string name="common_cancel_upload">Ð\9fÑ\80екини Ñ\81лање</string>
+ <string name="common_cancel_download">Откажи преузимање</string>
+ <string name="common_cancel_upload">Ð\9eÑ\82кажи оÑ\82пÑ\80емање</string>
<string name="common_cancel">Откажи</string>
<string name="common_save_exit">Сачувај и изађи</string>
<string name="common_error">Грешка</string>
<string name="uploader_upload_in_progress_ticker">Отпремам…</string>
<string name="uploader_upload_in_progress_content">%1$d%% Отпремам %2$s</string>
<string name="uploader_upload_succeeded_ticker">Отпремање је успело</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_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_download_failed_content">Не могу да довршим преузимање %1$s</string>
<string name="downloader_not_downloaded_yet">Још увек није преузето</string>
- <string name="common_choose_account">Изабери налог</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_content">Не могу да довршим синхронизацију датотеке %1$s</string>
- <string name="foreign_files_success">Све датотеке су померене</string>
- <string name="foreign_files_fail">Неке датотеке нису могле бити померене</string>
- <string name="pincode_enter_pin_code">Унесите PIN апликације</string>
- <string name="pincode_configure_your_pin_explanation">Са сваким покретањем апликације мораћете да унесете PIN</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_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">Унесите ПИБ апликације</string>
+ <string name="pincode_configure_your_pin">Унесите ПИБ за апликацију</string>
+ <string name="pincode_configure_your_pin_explanation">Са сваким покретањем апликације мораћете да унесете ПИБ</string>
+ <string name="pincode_reenter_your_pincode">Унесите ПИБ поново</string>
+ <string name="pincode_remove_your_pincode">Уклоните ПИБ апликације</string>
+ <string name="pincode_mismatch">Бројеви се не поклапају</string>
+ <string name="pincode_wrong">Неисправан ПИБ</string>
+ <string name="pincode_removed">ПИБ је уклоњен</string>
+ <string name="pincode_stored">ПИБ је упамћен</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_unknown_error_title">Дошло је до непознате грешке.</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">Погрешно уобличена адреса</string>
- <string name="auth_ssl_general_error_title">Покретање SSL-а није успело</string>
+ <string name="auth_ssl_general_error_title">ССЛ иницијализација није успела</string>
+ <string name="auth_ssl_unverified_server_title">Не могу да проверим ССЛ идентитет сервера</string>
+ <string name="auth_bad_oc_version_title">Непозната верзија сервера</string>
<string name="auth_wrong_connection_title">Не могу да успоставим везу</string>
<string name="auth_secure_connection">Безбедна веза је успостављена</string>
- <string name="fd_keep_in_sync">Редовно ажурирај датотеку</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="auth_account_does_not_exist">Не постоји налог на уређају</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="confirmation_remove_remote_and_local">Удаљено и локално</string>
- <string name="rename_dialog_title">Унесите ново име</string>
+ <string name="remove_success_msg">Уклањање успешно</string>
+ <string name="remove_fail_msg">Уклањање неуспешно</string>
+ <string name="rename_dialog_title">Унесите нов назив</string>
+ <string name="rename_local_fail_msg">Локална копија се не може преименовати. Покушајте други назив</string>
<string name="rename_server_fail_msg">Не могу да довршим преименовање</string>
- <string name="sync_file_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_no_file_selected">Нисте изабрали датотеку</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">â\80\93 СеÑ\80Ñ\82иÑ\84икаÑ\82 Ñ\81еÑ\80веÑ\80а ниÑ\98е повеÑ\80Ñ\99ив</string>
+ <string name="ssl_validator_reason_cert_not_trusted">â\80\93 СеÑ\80Ñ\82иÑ\84икаÑ\82 Ñ\81еÑ\80веÑ\80а ниÑ\98е од повеÑ\80еÑ\9aа</string>
<string name="ssl_validator_reason_cert_expired">– Сертификат сервера је истекао</string>
+ <string name="ssl_validator_reason_cert_not_yet_valid">- Датуми важења сертификата су у будућности</string>
<string name="ssl_validator_reason_hostname_not_verified">– Адреса се не поклапа са именом домаћина у сертификату</string>
- <string name="ssl_validator_question">Ð\96елиÑ\82е ли ипак да ознаÑ\87иÑ\82е Ñ\81еÑ\80Ñ\82иÑ\84икаÑ\82 као повеÑ\80Ñ\99ив?</string>
+ <string name="ssl_validator_question">Ð\96елиÑ\82е ли ипак да веÑ\80Ñ\83Ñ\98еÑ\82е Ñ\81еÑ\80Ñ\82иÑ\84икаÑ\82Ñ\83?</string>
<string name="ssl_validator_not_saved">Не могу да сачувам сертификат</string>
<string name="ssl_validator_btn_details_see">Подаци</string>
<string name="ssl_validator_btn_details_hide">Сакриј</string>
<string name="ssl_validator_label_subject">Издато за:</string>
- <string name="ssl_validator_label_issuer">Ð\98здао/ла:</string>
+ <string name="ssl_validator_label_issuer">Ð\98здаваÑ\87:</string>
<string name="ssl_validator_label_CN">Уобичајено име:</string>
<string name="ssl_validator_label_O">Организација:</string>
<string name="ssl_validator_label_OU">Организациона јединица:</string>
- <string name="ssl_validator_label_C">Ð\97емÑ\99а:</string>
- <string name="ssl_validator_label_ST">Ð\94Ñ\80жава:</string>
+ <string name="ssl_validator_label_C">Ð\94Ñ\80жава:</string>
+ <string name="ssl_validator_label_ST">Ð\9fокÑ\80аÑ\98ина:</string>
<string name="ssl_validator_label_L">Локација:</string>
<string name="ssl_validator_label_validity">Ваљаност:</string>
<string name="ssl_validator_label_validity_from">Од:</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">чувамместо.txt</string>
+ <string name="placeholder_filetype">ПНГ слика</string>
+ <string name="placeholder_filesize">389 KB</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">Отпремај слике само путем бежичне мреже</string>
+ <string name="instant_video_upload_on_wifi">Отпремај видео само путем бежичне мреже</string>
<string name="conflict_title">Ажурирај сукоб</string>
+ <string name="conflict_message">Удаљени фајл %s није синхронизован са локалним. Ако наставите, заменићете фајл на серверу.</string>
<string name="conflict_keep_both">Задржи оба</string>
- <string name="share_link_file_error">Дошло је до грешке приликом покушаја дељења ове датотеке или фасцикле</string>
- <string name="unshare_link_file_error">Дошло је до грешке приликом покушаја укидања дељења ове датотеке или фасцикле</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="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">да Ñ\83кинеÑ\82е деÑ\99еÑ\9aе ове даÑ\82оÑ\82еке</string>
- <string name="forbidden_permissions_create">да направите датотеку</string>
- <string name="uploader_upload_forbidden_permissions">да оÑ\82пÑ\80емиÑ\82е овÑ\83 даÑ\82оÑ\82еку</string>
- <string name="downloader_download_file_not_found">Ð\94аÑ\82оÑ\82ека ниÑ\98е виÑ\88е доÑ\81Ñ\82Ñ\83пна на серверу</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">да Ñ\83кинеÑ\82е деÑ\99еÑ\9aе овог Ñ\84аÑ\98ла</string>
+ <string name="forbidden_permissions_create">да направите фајл</string>
+ <string name="uploader_upload_forbidden_permissions">да оÑ\82пÑ\80емаÑ\82е Ñ\83 овÑ\83 Ñ\84аÑ\81Ñ\86иклу</string>
+ <string name="downloader_download_file_not_found">ФаÑ\98л ниÑ\98е виÑ\88е доÑ\81Ñ\82Ñ\83пан на серверу</string>
<string name="prefs_category_accounts">Налози</string>
<string name="prefs_add_account">Додај налог</string>
- <string name="log_send_history_button">Историја слања</string>
- <string name="log_progress_dialog_text">Учитацање података...</string>
+ <string name="auth_redirect_non_secure_connection_title">Безбедна веза је преусмерена на небезбедну руту</string>
+ <string name="actionbar_logger">Записници</string>
+ <string name="log_send_history_button">Историјат слања</string>
+ <string name="log_send_no_mail_app">Нема начина за слање записника. Инсталирајте апликацију е-поште!</string>
+ <string name="log_send_mail_subject">Записници %1$s Андроид апликације</string>
+ <string name="log_progress_dialog_text">Учитавам податке...</string>
<string name="saml_authentication_required_text">Неопходна провера идентитета</string>
- <string name="saml_authentication_wrong_pass">Лозинка пограшна</string>
+ <string name="saml_authentication_wrong_pass">Погрешна лозинка</string>
+ <string name="actionbar_move">Премести</string>
+ <string name="file_list_empty_moving">Овде нема ничега. Можете додати фасциклу!</string>
<string name="folder_picker_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>
+ <string name="prefs_instant_video_upload_path_title">Путања отпремања видеа</string>
+ <string name="download_folder_failed_content">Преузимање фасцикле %1$s не може бити довршено</string>
+ <string name="subject_token">%1$s подели „%2$s“ са вама</string>
</resources>
<string name="auth_fail_get_user_name">Sunucunuz geçerli bir kullanıcı kimliği döndürmüyor, lütfen yöneticinizle iletişime geçin
</string>
<string name="auth_can_not_auth_against_server">Bu sunucuya karşı kimlik doğrulama yapılamaz</string>
+ <string name="auth_account_does_not_exist">Hesap henüz cihazda mevcut değil</string>
<string name="fd_keep_in_sync">Dosyayı güncel tut</string>
<string name="common_rename">Yeniden adlandır</string>
<string name="common_remove">Kaldır</string>
<!--
ownCloud Android client application
- Copyright (C) 2012-2013 ownCloud Inc.
+ Copyright (C) 2015 ownCloud Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License version 2,
ownCloud Android client application
Copyright (C) 2012 Bartek Przybylski
- Copyright (C) 2012-2013 ownCloud Inc.
+ Copyright (C) 2015 ownCloud Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License version 2,
ownCloud Android client application
Copyright (C) 2012 Bartek Przybylski
- Copyright (C) 2012-2013 ownCloud Inc.
+ Copyright (C) 2015 ownCloud Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License version 2,
ownCloud Android client application
Copyright (C) 2012 Bartek Przybylski
- Copyright (C) 2012-2013 ownCloud Inc.
+ Copyright (C) 2015 ownCloud Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License version 2,
ownCloud Android client application
Copyright (C) 2012 Bartek Przybylski
- Copyright (C) 2012-2013 ownCloud Inc.
+ Copyright (C) 2015 ownCloud Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License version 2,
ownCloud Android client application
Copyright (C) 2012 Bartek Przybylski
- Copyright (C) 2012-2013 ownCloud Inc.
+ Copyright (C) 2015 ownCloud Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License version 2,
-/* ownCloud Android client application
- * Copyright (C) 2012-2015 ownCloud Inc.
+/**
+ * ownCloud Android client application
+ *
+ * @author masensio
+ * @author David A. Velasco
+ * Copyright (C) 2015 ownCloud Inc.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2,
*
* Contains methods to build the "static" strings. These strings were before constants in different
* classes
- *
- * @author masensio
- * @author David A. Velasco
*/
public class MainApp extends Application {
-/* ownCloud Android client application
+/**
+ * ownCloud Android client application
+ *
+ * @author David A. Velasco
* Copyright (C) 2012 Bartek Przybylski
- * Copyright (C) 2012-2013 ownCloud Inc.
+ * Copyright (C) 2015 ownCloud Inc.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2,
* Controller class accessed from the system AccountManager, providing integration of ownCloud accounts with the Android system.
*
* TODO - better separation in operations for OAuth-capable and regular ownCloud accounts.
- * TODO - review completeness
- *
- * @author David A. Velasco
+ * TODO - review completeness
*/
public class AccountAuthenticator extends AbstractAccountAuthenticator {
return bundle;
}
- /**\r
- * {@inheritDoc}\r
- */\r
- @Override\r
- public Bundle confirmCredentials(AccountAuthenticatorResponse response,\r
- Account account, Bundle options) throws NetworkErrorException {\r
- try {\r
- validateAccountType(account.type);\r
- } catch (AuthenticatorException e) {\r
- Log_OC.e(TAG, "Failed to validate account type " + account.type + ": "\r
- + e.getMessage());\r
- e.printStackTrace();\r
- return e.getFailureBundle();\r
- }\r
- Intent intent = new Intent(mContext, AuthenticatorActivity.class);\r
- intent.putExtra(AccountManager.KEY_ACCOUNT_AUTHENTICATOR_RESPONSE,\r
- response);\r
- intent.putExtra(KEY_ACCOUNT, account);\r
- intent.putExtra(KEY_LOGIN_OPTIONS, options);\r
-\r
- setIntentFlags(intent);\r
-\r
- Bundle resultBundle = new Bundle();\r
- resultBundle.putParcelable(AccountManager.KEY_INTENT, intent);\r
- return resultBundle;\r
- }\r
-\r
- @Override\r
- public Bundle editProperties(AccountAuthenticatorResponse response,\r
- String accountType) {\r
- return null;\r
- }\r
-\r
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public Bundle confirmCredentials(AccountAuthenticatorResponse response,
+ Account account, Bundle options) throws NetworkErrorException {
+ try {
+ validateAccountType(account.type);
+ } catch (AuthenticatorException e) {
+ Log_OC.e(TAG, "Failed to validate account type " + account.type + ": "
+ + e.getMessage());
+ e.printStackTrace();
+ return e.getFailureBundle();
+ }
+ Intent intent = new Intent(mContext, AuthenticatorActivity.class);
+ intent.putExtra(AccountManager.KEY_ACCOUNT_AUTHENTICATOR_RESPONSE,
+ response);
+ intent.putExtra(KEY_ACCOUNT, account);
+ intent.putExtra(KEY_LOGIN_OPTIONS, options);
+
+ setIntentFlags(intent);
+
+ Bundle resultBundle = new Bundle();
+ resultBundle.putParcelable(AccountManager.KEY_INTENT, intent);
+ return resultBundle;
+ }
+
+ @Override
+ public Bundle editProperties(AccountAuthenticatorResponse response,
+ String accountType) {
+ return null;
+ }
+
/**
* {@inheritDoc}
*/
}
}
- private void validateAuthTokenType(String authTokenType)\r
- throws UnsupportedAuthTokenTypeException {\r
- if (!authTokenType.equals(MainApp.getAuthTokenType()) &&\r
- !authTokenType.equals(AccountTypeUtils.getAuthTokenTypePass(MainApp.getAccountType())) &&\r
- !authTokenType.equals(AccountTypeUtils.getAuthTokenTypeAccessToken(MainApp.getAccountType())) &&\r
+ private void validateAuthTokenType(String authTokenType)
+ throws UnsupportedAuthTokenTypeException {
+ if (!authTokenType.equals(MainApp.getAuthTokenType()) &&
+ !authTokenType.equals(AccountTypeUtils.getAuthTokenTypePass(MainApp.getAccountType())) &&
+ !authTokenType.equals(AccountTypeUtils.getAuthTokenTypeAccessToken(MainApp.getAccountType())) &&
!authTokenType.equals(AccountTypeUtils.getAuthTokenTypeRefreshToken(MainApp.getAccountType())) &&
- !authTokenType.equals(AccountTypeUtils.getAuthTokenTypeSamlSessionCookie(MainApp.getAccountType()))) {\r
- throw new UnsupportedAuthTokenTypeException();\r
- }\r
- }\r
-\r
- public static class AuthenticatorException extends Exception {\r
- private static final long serialVersionUID = 1L;\r
- private Bundle mFailureBundle;\r
-\r
- public AuthenticatorException(int code, String errorMsg) {\r
- mFailureBundle = new Bundle();\r
- mFailureBundle.putInt(AccountManager.KEY_ERROR_CODE, code);\r
- mFailureBundle\r
- .putString(AccountManager.KEY_ERROR_MESSAGE, errorMsg);\r
- }\r
-\r
- public Bundle getFailureBundle() {\r
- return mFailureBundle;\r
- }\r
- }\r
-\r
- public static class UnsupportedAccountTypeException extends\r
- AuthenticatorException {\r
- private static final long serialVersionUID = 1L;\r
-\r
- public UnsupportedAccountTypeException() {\r
- super(AccountManager.ERROR_CODE_UNSUPPORTED_OPERATION,\r
- "Unsupported account type");\r
- }\r
- }\r
-\r
- public static class UnsupportedAuthTokenTypeException extends\r
- AuthenticatorException {\r
- private static final long serialVersionUID = 1L;\r
-\r
- public UnsupportedAuthTokenTypeException() {\r
- super(AccountManager.ERROR_CODE_UNSUPPORTED_OPERATION,\r
- "Unsupported auth token type");\r
- }\r
- }\r
-\r
- public static class UnsupportedFeaturesException extends\r
- AuthenticatorException {\r
- public static final long serialVersionUID = 1L;\r
-\r
- public UnsupportedFeaturesException() {\r
- super(AccountManager.ERROR_CODE_UNSUPPORTED_OPERATION,\r
- "Unsupported features");\r
- }\r
- }\r
-\r
- public static class AccessDeniedException extends AuthenticatorException {\r
- public AccessDeniedException(int code, String errorMsg) {\r
- super(AccountManager.ERROR_CODE_INVALID_RESPONSE, "Access Denied");\r
- }\r
-\r
- private static final long serialVersionUID = 1L;\r
-\r
- }\r
-}\r
+ !authTokenType.equals(AccountTypeUtils.getAuthTokenTypeSamlSessionCookie(MainApp.getAccountType()))) {
+ throw new UnsupportedAuthTokenTypeException();
+ }
+ }
+
+ public static class AuthenticatorException extends Exception {
+ private static final long serialVersionUID = 1L;
+ private Bundle mFailureBundle;
+
+ public AuthenticatorException(int code, String errorMsg) {
+ mFailureBundle = new Bundle();
+ mFailureBundle.putInt(AccountManager.KEY_ERROR_CODE, code);
+ mFailureBundle
+ .putString(AccountManager.KEY_ERROR_MESSAGE, errorMsg);
+ }
+
+ public Bundle getFailureBundle() {
+ return mFailureBundle;
+ }
+ }
+
+ public static class UnsupportedAccountTypeException extends
+ AuthenticatorException {
+ private static final long serialVersionUID = 1L;
+
+ public UnsupportedAccountTypeException() {
+ super(AccountManager.ERROR_CODE_UNSUPPORTED_OPERATION,
+ "Unsupported account type");
+ }
+ }
+
+ public static class UnsupportedAuthTokenTypeException extends
+ AuthenticatorException {
+ private static final long serialVersionUID = 1L;
+
+ public UnsupportedAuthTokenTypeException() {
+ super(AccountManager.ERROR_CODE_UNSUPPORTED_OPERATION,
+ "Unsupported auth token type");
+ }
+ }
+
+ public static class UnsupportedFeaturesException extends
+ AuthenticatorException {
+ public static final long serialVersionUID = 1L;
+
+ public UnsupportedFeaturesException() {
+ super(AccountManager.ERROR_CODE_UNSUPPORTED_OPERATION,
+ "Unsupported features");
+ }
+ }
+
+ public static class AccessDeniedException extends AuthenticatorException {
+ public AccessDeniedException(int code, String errorMsg) {
+ super(AccountManager.ERROR_CODE_INVALID_RESPONSE, "Access Denied");
+ }
+
+ private static final long serialVersionUID = 1L;
+
+ }
+}
-/* ownCloud Android client application
+/**
+ * ownCloud Android client application
+ *
* Copyright (C) 2011 Bartek Przybylski
- * Copyright (C) 2012-2013 ownCloud Inc.
+ * Copyright (C) 2015 ownCloud Inc.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2,
-/* ownCloud Android client application\r
+/**\r
+ * ownCloud Android client application\r
+ *\r
* Copyright (C) 2012 Bartek Przybylski\r
- * Copyright (C) 2012-2013 ownCloud Inc.\r
+ * Copyright (C) 2015 ownCloud Inc.\r
*\r
* This program is free software: you can redistribute it and/or modify\r
* it under the terms of the GNU General Public License version 2,\r
-/* ownCloud Android client application\r
+/**\r
+ * ownCloud Android client application\r
+ *\r
+ * @author Bartek Przybylski\r
+ * @author David A. Velasco\r
+ * @author masensio\r
* Copyright (C) 2012 Bartek Przybylski\r
- * Copyright (C) 2012-2015 ownCloud Inc.\r
+ * Copyright (C) 2015 ownCloud Inc.\r
*\r
* This program is free software: you can redistribute it and/or modify\r
* it under the terms of the GNU General Public License version 2,\r
\r
/**\r
* This Activity is used to add an ownCloud account to the App\r
- * \r
- * @author Bartek Przybylski\r
- * @author David A. Velasco\r
- * @author masensio\r
*/\r
public class AuthenticatorActivity extends AccountAuthenticatorActivity\r
implements OnRemoteOperationListener, OnFocusChangeListener, OnEditorActionListener,\r
-/* ownCloud Android client application
- * Copyright (C) 2012-2015 ownCloud Inc.
+/**
+ * ownCloud Android client application
+ *
+ * @author masensio on 09/02/2015.
+ * Copyright (C) 2015 ownCloud Inc.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2,
/**
* Async Task to verify the credentials of a user
- *
- * @author masensio on 09/02/2015.
*/
public class AuthenticatorAsyncTask extends AsyncTask<Object, Void, RemoteOperationResult> {
-/* ownCloud Android client application
- * Copyright (C) 2012-2013 ownCloud Inc.
+/**
+ * ownCloud Android client application
+ *
+ * @author David A. Velasco
+ * Copyright (C) 2015 ownCloud Inc.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2,
* Constant values for OAuth 2 protocol.
*
* Includes required and optional parameter NAMES used in the 'authorization code' grant type.
- *
- * @author David A. Velasco
*/
public class OAuth2Constants {
-/* ownCloud Android client application
- * Copyright (C) 2012-2015 ownCloud Inc.
+/**
+ * ownCloud Android client application
+ *
+ * @author David A. Velasco
+ * Copyright (C) 2015 ownCloud Inc.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2,
*
* Assumes that the single-sign-on is kept thanks to a cookie set at the end of the
* authentication process.
- *
- * @author David A. Velasco
*/
public class SsoWebViewClient extends WebViewClient {
-/* ownCloud Android client application
+/**
+ * ownCloud Android client application
+ *
* Copyright (C) 2012 Bartek Przybylski
- * Copyright (C) 2012-2014 ownCloud Inc.
+ * Copyright (C) 2015 ownCloud Inc.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2,
-/* ownCloud Android client application
+/**
+ * ownCloud Android client application
+ *
* Copyright (C) 2012 Bartek Przybylski
- * Copyright (C) 2012-2013 ownCloud Inc.
+ * Copyright (C) 2015 ownCloud Inc.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2,
-/* ownCloud Android client application
- * Copyright (C) 2012-2014 ownCloud Inc.
+/**
+ * ownCloud Android client application
+ *
+ * @author Tobias Kaminsky
+ * @author David A. Velasco
+ * Copyright (C) 2015 ownCloud Inc.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2,
import com.owncloud.android.utils.DisplayUtils;
/**
- * Manager for concurrent access to thumbnails cache.
- *
- * @author Tobias Kaminsky
- * @author David A. Velasco
+ * Manager for concurrent access to thumbnails cache.
*/
public class ThumbnailsCacheManager {
-/* ownCloud Android client application
+/**
+ * ownCloud Android client application
+ *
+ * @author Bartek Przybylski
* Copyright (C) 2011-2012 Bartek Przybylski
- * Copyright (C) 2012-2013 ownCloud Inc.
+ * Copyright (C) 2015 ownCloud Inc.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2,
/**
* Custom database helper for ownCloud
- *
- * @author Bartek Przybylski
- *
*/
public class DbHandler {
private SQLiteDatabase mDB;
-/* ownCloud Android client application\r
+/**\r
+ * ownCloud Android client application\r
+ *\r
+ * @author Bartek Przybylski\r
* Copyright (C) 2011 Bartek Przybylski\r
- * Copyright (C) 2012-2013 ownCloud Inc.\r
+ * Copyright (C) 2015 ownCloud Inc.\r
*\r
* This program is free software: you can redistribute it and/or modify\r
* it under the terms of the GNU General Public License version 2,\r
\r
/**\r
* Meta-Class that holds various static field information\r
- * \r
- * @author Bartek Przybylski\r
- * \r
*/\r
public class ProviderMeta {\r
\r
-/* ownCloud Android client application
+/**
+ * ownCloud Android client application
+ *
+ * @author David A. Velasco
* Copyright (C) 2012 Bartek Przybylski
- * Copyright (C) 2012-2013 ownCloud Inc.
+ * Copyright (C) 2015 ownCloud Inc.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2,
/**
* App-registered receiver catching the broadcast intent reporting that the system was
* just boot up.
- *
- * @author David A. Velasco
*/
public class BootupBroadcastReceiver extends BroadcastReceiver {
-/* ownCloud Android client application
- * Copyright (C) 2014 ownCloud Inc.
+/**
+ * ownCloud Android client application
+ *
+ * @author David A. Velasco
+ * Copyright (C) 2015 ownCloud Inc.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2,
/**
* Filters out the file actions available in a given {@link Menu} for a given {@link OCFile}
* according to the current state of the latest.
- *
- * @author David A. Velasco
*/
public class FileMenuFilter {
-/* ownCloud Android client application
- * Copyright (C) 2012-2015 ownCloud Inc.
+/**
+ * ownCloud Android client application
+ *
+ * @author masensio
+ * @author David A. Velasco
+ * Copyright (C) 2015 ownCloud Inc.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2,
import com.owncloud.android.ui.dialog.ShareLinkToDialog;
/**
- *
- * @author masensio
- * @author David A. Velasco
+ *
*/
public class FileOperationsHelper {
-/* ownCloud Android client application
+/**
+ * ownCloud Android client application
+ *
* Copyright (C) 2012 Bartek Przybylski
- * Copyright (C) 2012-2014 ownCloud Inc.
+ * Copyright (C) 2015 ownCloud Inc.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2,
-/* ownCloud Android client application
+/**
+ * ownCloud Android client application
+ *
* Copyright (C) 2012 Bartek Przybylski
* Copyright (C) 2012-2015 ownCloud Inc.
*
-/* ownCloud Android client application
+/**
+ * ownCloud Android client application
+ *
* Copyright (C) 2012 Bartek Przybylski
* Copyright (C) 2012-2015 ownCloud Inc.
*
-/* ownCloud Android client application
+/**
+ * ownCloud Android client application
+ *
+ * @author David A. Velasco
* Copyright (C) 2015 ownCloud Inc.
*
* This program is free software: you can redistribute it and/or modify
* A map provides the indexation based in hashing.
*
* A tree is created per account.
- *
- * @author David A. Velasco
*/
public class IndexedForest<V> {
-/* ownCloud Android client application
+/**
+ * ownCloud Android client application
+ *
* Copyright (C) 2012 Bartek Przybylski
- * Copyright (C) 2012-2013 ownCloud Inc.
+ * Copyright (C) 2015 ownCloud Inc.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2,
-/* ownCloud Android client application
- *
- * Copyright (C) 2012-2013 ownCloud Inc.
+/**
+ * ownCloud Android client application
+ *
+ * @author David A. Velasco
+ * Copyright (C) 2015 ownCloud Inc.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2,
*
* It synchronizes itself with the state of the
* {@link MediaPlayer}.
- *
- * @author David A. Velasco
*/
public class MediaControlView extends FrameLayout /* implements OnLayoutChangeListener, OnTouchListener */ implements OnClickListener, OnSeekBarChangeListener {
-/* ownCloud Android client application
- * Copyright (C) 2012-2013 ownCloud Inc.
+/**
+ * ownCloud Android client application
+ *
+ * @author David A. Velasco
+ * Copyright (C) 2015 ownCloud Inc.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2,
*
* Waits for Intents which signal the service to perform specific operations: Play, Pause,
* Rewind, etc.
- *
- * @author David A. Velasco
*/
public class MediaService extends Service implements OnCompletionListener, OnPreparedListener,
OnErrorListener, AudioManager.OnAudioFocusChangeListener {
-/* ownCloud Android client application
- * Copyright (C) 2012-2013 ownCloud Inc.
+/**
+ * ownCloud Android client application
+ *
+ * @author David A. Velasco
+ * Copyright (C) 2015 ownCloud Inc.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2,
*
* Provides the operations of {@link MediaController.MediaPlayerControl}, and an extra method to check if
* an {@link OCFile} instance is handled by the MediaService.
- *
- * @author David A. Velasco
*/
public class MediaServiceBinder extends Binder implements MediaController.MediaPlayerControl {
-/* ownCloud Android client application
- * Copyright (C) 2014 ownCloud Inc.
+/**
+ * ownCloud Android client application
+ *
+ * @author David A. Velasco
+ * Copyright (C) 2015 ownCloud Inc.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2,
* a progress bar is available in every Android version, because
* {@link NotificationCompat.Builder#setProgress(int, int, boolean)} has no
* real effect for Android < 4.0
- *
- * @author David A. Velasco
*/
public class NotificationBuilderWithProgressBar extends NotificationCompat.Builder {
+/**
+ * ownCloud Android client application
+ *
+ * Copyright (C) 2015 ownCloud Inc.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2,
+ * as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
package com.owncloud.android.notifications;
import java.util.Random;
-/* ownCloud Android client application
- * Copyright (C) 2014 ownCloud Inc.
+/**
+ * ownCloud Android client application
+ *
+ * @author David A. Velasco
+ * @author masensio
+ * Copyright (C) 2015 ownCloud Inc.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2,
/**
* Access to remote operation performing the creation of a new folder in the ownCloud server.
* Save the new folder in Database
- *
- * @author David A. Velasco
- * @author masensio
*/
public class CreateFolderOperation extends SyncOperation implements OnRemoteOperationListener{
-/* ownCloud Android client application
- * Copyright (C) 2014 ownCloud Inc.
+/**
+ * ownCloud Android client application
+ *
+ * @author masensio
+ * Copyright (C) 2015 ownCloud Inc.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2,
/**
* Creates a new share from a given file
- *
- * @author masensio
- *
*/
import android.content.Context;
-/* ownCloud Android Library is available under MIT license
- * Copyright (C) 2014 ownCloud Inc.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
- * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
- * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
- * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
- * THE SOFTWARE.
+/**
+ * ownCloud Android client application
+ *
+ * @author David A. Velasco
+ * Copyright (C) 2015 ownCloud Inc.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2,
+ * as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
* When successful, the instance of {@link RemoteOperationResult} passed
* through {@link OnRemoteOperationListener#onRemoteOperationFinish(RemoteOperation,
* RemoteOperationResult)} returns in {@link RemoteOperationResult#getData()}
- * a value of {@link AuthenticationMethod}.
- *
- * @author David A. Velasco
+ * a value of {@link AuthenticationMethod}.
*/
public class DetectAuthenticationMethodOperation extends RemoteOperation {
-/* ownCloud Android client application
- * Copyright (C) 2012-2013 ownCloud Inc.
+/**
+ * ownCloud Android client application
+ *
+ * @author David A. Velasco
+ * @author masensio
+ * Copyright (C) 2015 ownCloud Inc.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2,
/**
* Remote mDownloadOperation performing the download of a file to an ownCloud server
- *
- * @author David A. Velasco
- * @author masensio
*/
public class DownloadFileOperation extends RemoteOperation {
-/* ownCloud Android Library is available under MIT license
- * Copyright (C) 2014 ownCloud Inc.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
- * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
- * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
- * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
- * THE SOFTWARE.
+/**
+ * ownCloud Android client application
+ *
+ * @author David A. Velasco
+ * @author masensio
+ * Copyright (C) 2015 ownCloud Inc.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2,
+ * as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
*
* Checks the existence of a configured ownCloud server in the URL, gets its version
* and finds out what authentication method is needed to access files in it.
- *
- * @author David A. Velasco
- * @author masensio
*/
public class GetServerInfoOperation extends RemoteOperation {
-/* ownCloud Android client application
- * Copyright (C) 2012-2013 ownCloud Inc.
+/**
+ * ownCloud Android client application
+ *
+ * @author masensio
+ * Copyright (C) 2015 ownCloud Inc.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2,
import com.owncloud.android.operations.common.SyncOperation;
/**
- * Provide a list shares for a specific file.
- *
- * @author masensio
- *
+ * Provide a list shares for a specific file.
*/
public class GetSharesForFileOperation extends SyncOperation {
-/* ownCloud Android client application
- * Copyright (C) 2012-2014 ownCloud Inc.
+/**
+ * ownCloud Android client application
+ *
+ * @author masensio
+ * @author David A. Velasco
+ * Copyright (C) 2015 ownCloud Inc.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2,
/**
* Access to remote operation to get the share files/folders
* Save the data in Database
- *
- * @author masensio
- * @author David A. Velasco
*/
public class GetSharesOperation extends SyncOperation {
-/* ownCloud Android client application
- * Copyright (C) 2012-2014 ownCloud Inc.
+/**
+ * ownCloud Android client application
+ *
+ * @author David A. Velasco
+ * Copyright (C) 2015 ownCloud Inc.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2,
/**
* Operation mmoving an {@link OCFile} to a different folder.
- *
- * @author David A. Velasco
*/
public class MoveFileOperation extends SyncOperation {
+/**
+ * ownCloud Android client application
+ *
+ * Copyright (C) 2015 ownCloud Inc.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2,
+ * as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
package com.owncloud.android.operations;
import java.util.ArrayList;
-/* ownCloud Android client application
- * Copyright (C) 2012-2014 ownCloud Inc.
+/**
+ * ownCloud Android client application
+ *
+ * @author David A. Velasco
+ * Copyright (C) 2015 ownCloud Inc.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2,
* properties, and updates the local database with them.
*
* Does NOT enter in the child folders to synchronize their contents also.
- *
- * @author David A. Velasco
*/
public class RefreshFolderOperation extends RemoteOperation {
-/* ownCloud Android client application
- * Copyright (C) 2012-2014 ownCloud Inc.
+/**
+ * ownCloud Android client application
+ *
+ * @author David A. Velasco
+ * @author masensio
+ * Copyright (C) 2015 ownCloud Inc.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2,
/**
* Remote operation performing the removal of a remote file or folder in the ownCloud server.
- *
- * @author David A. Velasco
- * @author masensio
*/
public class RemoveFileOperation extends SyncOperation {
-/* ownCloud Android client application
- * Copyright (C) 2012-2014 ownCloud Inc.
+/**
+ * ownCloud Android client application
+ *
+ * @author David A. Velasco
+ * @author masensio
+ * Copyright (C) 2015 ownCloud Inc.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2,
/**
* Remote operation performing the rename of a remote file (or folder?) in the ownCloud server.
- *
- * @author David A. Velasco
- * @author masensio
*/
public class RenameFileOperation extends SyncOperation {
-/* ownCloud Android client application
+/**
+ * ownCloud Android client application
+ *
+ * @author David A. Velasco
+ * @author masensio
* Copyright (C) 2012 Bartek Przybylski
- * Copyright (C) 2012-2014 ownCloud Inc.
+ * Copyright (C) 2015 ownCloud Inc.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2,
/**
* Remote operation performing the read of remote file in the ownCloud server.
- *
- * @author David A. Velasco
- * @author masensio
*/
public class SynchronizeFileOperation extends SyncOperation {
-/* ownCloud Android client application
- * Copyright (C) 2012-2014 ownCloud Inc.
+/**
+ * ownCloud Android client application
+ *
+ * @author David A. Velasco
+ * Copyright (C) 2015 ownCloud Inc.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2,
* properties, and updates the local database with them.
*
* Does NOT enter in the child folders to synchronize their contents also.
- *
- * @author David A. Velasco
*/
public class SynchronizeFolderOperation extends SyncOperation {
-/* ownCloud Android client application
- * Copyright (C) 2014 ownCloud Inc.
+/**
+ * ownCloud Android client application
+ *
+ * @author masensio
+ * Copyright (C) 2015 ownCloud Inc.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2,
/**
* Unshare file/folder
* Save the data in Database
- *
- * @author masensio
*/
public class UnshareLinkOperation extends SyncOperation {
-/* ownCloud Android client application
- * Copyright (C) 2012-2013 ownCloud Inc.
+/**
+ * ownCloud Android client application
+ *
+ * @author David A. Velasco
+ * Copyright (C) 2015 ownCloud Inc.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2,
/**
* Remote operation that checks the version of an ownCloud server and stores it locally
- *
- * @author David A. Velasco
*/
public class UpdateOCVersionOperation extends RemoteOperation {
-/* ownCloud Android client application
- * Copyright (C) 2012-2015 ownCloud Inc.
+/**
+ * ownCloud Android client application
+ *
+ * @author David A. Velasco
+ * Copyright (C) 2015 ownCloud Inc.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2,
/**
* Remote operation performing the upload of a file to an ownCloud server
- *
- * @author David A. Velasco
*/
public class UploadFileOperation extends RemoteOperation {
-/* ownCloud Android client application
- * Copyright (C) 2012-2014 ownCloud Inc.
+/**
+ * ownCloud Android client application
+ *
+ * @author David A. Velasco
+ * Copyright (C) 2015 ownCloud Inc.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2,
* with local data in the device.
*
* Provides methods to execute the operation both synchronously or asynchronously.
- *
- * @author David A. Velasco
*/
public abstract class SyncOperation extends RemoteOperation {
-/* ownCloud Android client application
+/**
+ * ownCloud Android client application
+ *
+ * @author Bartek Przybylski
+ * @author David A. Velasco
* Copyright (C) 2011 Bartek Przybylski
- * Copyright (C) 2012-2013 ownCloud Inc.
+ * Copyright (C) 2015 ownCloud Inc.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2,
/**
* The ContentProvider for the ownCloud App.
- *
- * @author Bartek Przybylski
- * @author David A. Velasco
- *
*/
public class FileContentProvider extends ContentProvider {
-/* ownCloud Android client application
- * Copyright (C) 2012-2014 ownCloud Inc.
+/**
+ * ownCloud Android client application
+ *
+ * Copyright (C) 2015 ownCloud Inc.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2,
-/* ownCloud Android client application
+/**
+ * ownCloud Android client application
+ *
* Copyright (C) 2015 ownCloud Inc.
*
* This program is free software: you can redistribute it and/or modify
-/* ownCloud Android client application
+/**
+ * ownCloud Android client application
+ *
+ * @author David A. Velasco
* Copyright (C) 2012 Bartek Przybylski
- * Copyright (C) 2012-2014 ownCloud Inc.
+ * Copyright (C) 2015 ownCloud Inc.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2,
* memory. To minimize the impact of this, the service always returns
* Service.START_STICKY, and the later restart of the service is explicitly
* considered in {@link FileObserverService#onStartCommand(Intent, int, int)}.
- *
- * @author David A. Velasco
*/
public class FileObserverService extends Service {
-/* ownCloud Android client application
- * Copyright (C) 2012-2014 ownCloud Inc.
+/**
+ * ownCloud Android client application
+ *
+ * @author David A. Velasco
+ * Copyright (C) 2015 ownCloud Inc.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2,
* The second case requires to monitor the folder parent of the files, since a direct
* {@link FileObserver} on it will not receive more events after the file is deleted to
* be replaced.
- *
- * @author David A. Velasco
*/
public class FolderObserver extends FileObserver {
-/* ownCloud Android client application\r
+/**\r
+ * ownCloud Android client application\r
+ *\r
+ * @author sassman\r
+ * @author David A. Velasco\r
* Copyright (C) 2011 Bartek Przybylski\r
- * Copyright (C) 2012-2013 ownCloud Inc.\r
+ * Copyright (C) 2015 ownCloud Inc.\r
*\r
* This program is free software: you can redistribute it and/or modify\r
* it under the terms of the GNU General Public License version 2,\r
* resource types, like FileSync, ConcatsSync, CalendarSync, etc..\r
* \r
* Implements the standard {@link AbstractThreadedSyncAdapter}.\r
- * \r
- * @author sassman\r
- * @author David A. Velasco\r
*/\r
public abstract class AbstractOwnCloudSyncAdapter extends\r
AbstractThreadedSyncAdapter {\r
-/* ownCloud Android client application
+/**
+ * ownCloud Android client application
+ *
* Copyright (C) 2012 Bartek Przybylski
- * Copyright (C) 2012-2013 ownCloud Inc.
+ * Copyright (C) 2015 ownCloud Inc.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2,
-/* ownCloud Android client application
+/**
+ * ownCloud Android client application
+ *
* Copyright (C) 2012 Bartek Przybylski
- * Copyright (C) 2012-2013 ownCloud Inc.
+ * Copyright (C) 2015 ownCloud Inc.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2,
-/* ownCloud Android client application
+/**
+ * ownCloud Android client application
+ *
+ * @author Bartek Przybylski
+ * @author David A. Velasco
* Copyright (C) 2011 Bartek Przybylski
- * Copyright (C) 2012-2013 ownCloud Inc.
+ * Copyright (C) 2015 ownCloud Inc.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2,
* ownCloud files.
*
* Performs a full synchronization of the account recieved in {@link #onPerformSync(Account, Bundle, String, ContentProviderClient, SyncResult)}.
- *
- * @author Bartek Przybylski
- * @author David A. Velasco
*/
public class FileSyncAdapter extends AbstractOwnCloudSyncAdapter {
-/* ownCloud Android client application\r
+/**\r
+ * ownCloud Android client application\r
+ *\r
+ * @author Bartek Przybylski\r
+ * @author David A. Velasco\r
* Copyright (C) 2011 Bartek Przybylski\r
- * Copyright (C) 2012-2013 ownCloud Inc.\r
+ * Copyright (C) 2015 ownCloud Inc.\r
*\r
* This program is free software: you can redistribute it and/or modify\r
* it under the terms of the GNU General Public License version 2,\r
/**\r
* Background service for synchronizing remote files with their local state.\r
* \r
- * Serves as a connector to an instance of {@link FileSyncAdapter}, as required by standard Android APIs. \r
- * \r
- * @author Bartek Przybylski\r
- * @author David A. Velasco\r
+ * Serves as a connector to an instance of {@link FileSyncAdapter}, as required by standard Android APIs.\r
*/\r
public class FileSyncService extends Service {\r
\r
-/* ownCloud Android client application\r
+/**\r
+ * ownCloud Android client application\r
+ *\r
+ * @author Bartek Przybylski\r
* Copyright (C) 2011 Bartek Przybylski\r
- * Copyright (C) 2012-2013 ownCloud Inc.\r
+ * Copyright (C) 2015 ownCloud Inc.\r
*\r
* This program is free software: you can redistribute it and/or modify\r
* it under the terms of the GNU General Public License version 2,\r
\r
/**\r
* Represents an Item on the ActionBar.\r
- * \r
- * @author Bartek Przybylski\r
- * \r
*/\r
public class ActionItem {\r
private Drawable mIcon;\r
-/* ownCloud Android client application
+/**
+ * ownCloud Android client application
+ *
* Copyright (C) 2014 ownCloud Inc.
*
* This program is free software: you can redistribute it and/or modify
-/* ownCloud Android client application\r
+/**\r
+ * ownCloud Android client application\r
+ *\r
+ * @author Lorensius. W. T\r
* Copyright (C) 2011 Bartek Przybylski\r
- * Copyright (C) 2012-2013 ownCloud Inc.\r
+ * Copyright (C) 2015 ownCloud Inc.\r
*\r
* This program is free software: you can redistribute it and/or modify\r
* it under the terms of the GNU General Public License version 2,\r
\r
/**\r
* Represents a custom PopupWindows\r
- * \r
- * @author Lorensius. W. T\r
- * \r
*/\r
public class CustomPopup {\r
protected final View mAnchor;\r
-/* ownCloud Android client application
+/**
+ * ownCloud Android client application
+ *
+ * @author David A. Velasco
* Copyright (C) 2012 Bartek Przybylski
* Copyright (C) 2012-2015 ownCloud Inc.
*
/**
* ListView allowing to specify the position of an item that should be centered in the visible area, if possible.
*
- * The cleanest way I found to overcome the problem due to getHeight() returns 0 until the view is really drawn.
- *
- * @author David A. Velasco
+ * The cleanest way I found to overcome the problem due to getHeight() returns 0 until the view is really drawn.
*/
public class ExtendedListView extends ListView {
-/* ownCloud Android client application
+/**
+ * ownCloud Android client application
+ *
* Copyright (C) 2014 ownCloud Inc.
*
* This program is free software: you can redistribute it and/or modify
-/* ownCloud Android client application\r
+/**\r
+ * ownCloud Android client application\r
+ *\r
+ * @author Lorensius. W. T\r
* Copyright (C) 2011 Bartek Przybylski\r
- * Copyright (C) 2012-2013 ownCloud Inc.\r
+ * Copyright (C) 2015 ownCloud Inc.\r
*\r
* This program is free software: you can redistribute it and/or modify\r
* it under the terms of the GNU General Public License version 2,\r
/**\r
* Popup window, shows action list as icon and text like the one in Gallery3D\r
* app.\r
- * \r
- * @author Lorensius. W. T\r
*/\r
public class QuickAction extends CustomPopup {\r
private final View root;\r
+/**
+ * ownCloud Android client application
+ *
+ * Copyright (C) 2015 ownCloud Inc.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2,
+ * as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
package com.owncloud.android.ui;
import android.content.Context;
-/* ownCloud Android client application
+/**
+ * ownCloud Android client application
+ *
* Copyright (C) 2015 ownCloud Inc.
*
* This program is free software: you can redistribute it and/or modify
-/* ownCloud Android client application
+/**
+ * ownCloud Android client application
+ *
* Copyright (C) 2015 ownCloud Inc.
*
* This program is free software: you can redistribute it and/or modify
-/* ownCloud Android client application
+/**
+ * ownCloud Android client application
+ *
* Copyright (C) 2012 Bartek Przybylski
- * Copyright (C) 2012-2013 ownCloud Inc.
+ * Copyright (C) 2015 ownCloud Inc.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2,
-/* ownCloud Android client application
+/**
+ * ownCloud Android client application
+ *
+ * @author Bartek Przybylski
+ * @author David A. Velasco
* Copyright (C) 2012 Bartek Przybylski
- * Copyright (C) 2012-2013 ownCloud Inc.
+ * Copyright (C) 2015 ownCloud Inc.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2,
/**
* Wrapper activity which will be launched if keep-in-sync file will be modified by external
- * application.
- *
- * @author Bartek Przybylski
- * @author David A. Velasco
+ * application.
*/
public class ConflictsResolveActivity extends FileActivity implements OnConflictDecisionMadeListener {
-/* ownCloud Android client application
- * Copyright (C) 2012-2014 ownCloud Inc.
+/**
+ * ownCloud Android client application
+ *
+ * @author David A. Velasco
+ * Copyright (C) 2015 ownCloud Inc.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2,
/**
* Activity copying the text of the received Intent into the system clibpoard.
- *
- * @author David A. Velasco
*/
@SuppressWarnings("deprecation")
public class CopyToClipboardActivity extends Activity {
-/* ownCloud Android client application
- * Copyright (C) 2012-2013 ownCloud Inc.
+/**
+ * ownCloud Android client application
+ *
+ * @author David A. Velasco
+ * Copyright (C) 2015 ownCloud Inc.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2,
* files.
*
* Shown when the error notification summarizing the list of errors is clicked by the user.
- *
- * @author David A. Velasco
*/
public class ErrorsWhileCopyingHandlerActivity extends SherlockFragmentActivity implements OnClickListener {
/**
* Customized adapter, showing the local files as main text in two-lines list item and the remote files
- * as the secondary text.
- *
- * @author David A. Velasco
+ * as the secondary text.
*/
public class ErrorsWhileCopyingListAdapter extends ArrayAdapter<String> {
/**
* Asynchronous task performing the move of all the local files to the ownCloud folder.
- *
- * @author David A. Velasco
*/
private class MoveFilesTask extends AsyncTask<Void, Void, Boolean> {
-/* ownCloud Android client application
+/**
+ * ownCloud Android client application
+ *
+ * @author David A. Velasco
* Copyright (C) 2011 Bartek Przybylski
- * Copyright (C) 2012-2015 ownCloud Inc.
+ * Copyright (C) 2015 ownCloud Inc.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2,
/**
* Activity with common behaviour for activities handling {@link OCFile}s in ownCloud {@link Account}s .
- *
- * @author David A. Velasco
*/
public class FileActivity extends SherlockFragmentActivity
implements OnRemoteOperationListener, ComponentsGetter {
* a new ownCloud {@link Account} finished, successfully or not.
*
* At this moment, only called after the creation of the first account.
- *
- * @author David A. Velasco
*/
public class AccountCreationCallback implements AccountManagerCallback<Bundle> {
-/* ownCloud Android client application
+/**
+ * ownCloud Android client application
+ *
+ * @author Bartek Przybylski
+ * @author David A. Velasco
* Copyright (C) 2011 Bartek Przybylski
- * Copyright (C) 2012-2015 ownCloud Inc.
+ * Copyright (C) 2015 ownCloud Inc.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2,
/**
* Displays, what files the user has available in his ownCloud.
- *
- * @author Bartek Przybylski
- * @author David A. Velasco
*/
public class FileDisplayActivity extends HookActivity implements
-/* ownCloud Android client application
- * Copyright (C) 2012-2014 ownCloud Inc.
+/**
+ * ownCloud Android client application
+ *
+ * Copyright (C) 2015 ownCloud Inc.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2,
-/* ownCloud Android client application
- * Copyright (C) 2012-2013 ownCloud Inc.
+/**
+ * ownCloud Android client application
+ *
+ * @author David A. Velasco
+ * Copyright (C) 2015 ownCloud Inc.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2,
*
* Added to show explanations for notifications when the user clicks on them, and there no place
* better to show them.
- *
- * @author David A. Velasco
*/
public class GenericExplanationActivity extends SherlockFragmentActivity {
-/* ownCloud Android client application
- * Copyright (C) 2012-2014 ownCloud Inc.
+/**
+ * ownCloud Android client application
+ *
+ * Copyright (C) 2015 ownCloud Inc.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2,
-/* ownCloud Android client application
- * Copyright (C) 2012-2013 ownCloud Inc.
+/**
+ * ownCloud Android client application
+ *
+ * Copyright (C) 2015 ownCloud Inc.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2,
+
+/**
+ * ownCloud Android client application
+ *
+ * @author David A. Velasco
+ * Copyright (C) 2015 ownCloud Inc.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2,
+ * as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
package com.owncloud.android.ui.activity;
import android.support.v4.widget.SwipeRefreshLayout;
-/* ownCloud Android client application
+/**
+ * ownCloud Android client application
+ *
* Copyright (C) 2011 Bartek Przybylski
+ * Copyright (C) 2015 ownCloud Inc.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2,
-/* ownCloud Android client application
+/**
+ * ownCloud Android client application
+ *
+ * @author Bartek Przybylski
+ * @author David A. Velasco
* Copyright (C) 2011 Bartek Przybylski
- * Copyright (C) 2012-2015 ownCloud Inc.
+ * Copyright (C) 2015 ownCloud Inc.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2,
/**
* An Activity that allows the user to change the application's settings.
- *
- * @author Bartek Przybylski
- * @author David A. Velasco
*/
public class Preferences extends SherlockPreferenceActivity
implements AccountManagerCallback<Boolean>, ComponentsGetter {
-/* ownCloud Android client application
- * Copyright (C) 2012-2013 ownCloud Inc.
+/**
+ * ownCloud Android client application
+ *
+ * @author David A. Velasco
+ * Copyright (C) 2015 ownCloud Inc.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2,
/**
* Displays local files and let the user choose what of them wants to upload
* to the current ownCloud account
- *
- * @author David A. Velasco
- *
*/
public class UploadFilesActivity extends FileActivity implements
* to upload into the ownCloud local folder.
*
* Maybe an AsyncTask is not strictly necessary, but who really knows.
- *
- * @author David A. Velasco
*/
private class CheckAvailableSpaceTask extends AsyncTask<Void, Void, Boolean> {
-/* ownCloud Android client application
- * Copyright (C) 2012-2014 ownCloud Inc.
+/**
+ * ownCloud Android client application
+ *
+ * Copyright (C) 2015 ownCloud Inc.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2,
-/* ownCloud Android client application
+/**
+ * ownCloud Android client application
+ *
+ * @author Bartek Przybylski
* Copyright (C) 2012 Bartek Przybylski
- * Copyright (C) 2012-2013 ownCloud Inc.
+ * Copyright (C) 2015 ownCloud Inc.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2,
/**
* This can be used to upload things to an ownCloud instance.
- *
- * @author Bartek Przybylski
- *
*/
public class Uploader extends SherlockListActivity implements OnItemClickListener, android.view.View.OnClickListener {
private static final String TAG = "ownCloudUploader";
-/* ownCloud Android client application
- * Copyright (C) 2012-2014 ownCloud Inc.
+/**
+ * ownCloud Android client application
+ *
+ * @author masensio
+ * @author David A. Velasco
+ * Copyright (C) 2015 ownCloud Inc.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2,
/**
* TODO
- *
- * @author masensio
- * @author David A. Velasco
*
*/
public class CertificateCombinedExceptionViewAdapter implements SslUntrustedCertDialog.ErrorViewAdapter {
-/* ownCloud Android client application
- * Copyright (C) 2012-2014 ownCloud Inc.
+/**
+ * ownCloud Android client application
+ *
+ * Copyright (C) 2015 ownCloud Inc.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2,
-/* ownCloud Android client application\r
+/**\r
+ * ownCloud Android client application\r
+ *\r
+ * @author Bartek Przybylski\r
+ * @author Tobias Kaminsky\r
+ * @author David A. Velasco\r
* Copyright (C) 2011 Bartek Przybylski\r
- * Copyright (C) 2012-2015 ownCloud Inc.\r
+ * Copyright (C) 2015 ownCloud Inc.\r
*\r
* This program is free software: you can redistribute it and/or modify\r
* it under the terms of the GNU General Public License version 2,\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
- * @author David A. Velasco\r
*/\r
public class FileListListAdapter extends BaseAdapter implements ListAdapter {\r
private final static String PERMISSION_SHARED_WITH_ME = "S";\r
-/* ownCloud Android client application
+/**
+ * ownCloud Android client application
+ *
+ * @author David A. Velasco
* Copyright (C) 2011 Bartek Przybylski
- * Copyright (C) 2012-2014 ownCloud Inc.
+ * Copyright (C) 2015 ownCloud Inc.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2,
/**
* This Adapter populates a ListView with all files and directories contained
* in a local directory
- *
- * @author David A. Velasco
- *
*/
public class LocalFileListAdapter extends BaseAdapter implements ListAdapter {
+/**
+ * ownCloud Android client application
+ *
+ * Copyright (C) 2015 ownCloud Inc.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2,
+ * as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
package com.owncloud.android.ui.adapter;
import java.io.File;
-/* ownCloud Android client application
- * Copyright (C) 2012-2014 ownCloud Inc.
+/**
+ * ownCloud Android client application
+ *
+ * @author masensio
+ * @author David A. Velasco
+ * Copyright (C) 2015 ownCloud Inc.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2,
/**
* TODO
- *
- * @author masensio
- * @author David A. Velasco
*/
public class SslCertificateViewAdapter implements SslUntrustedCertDialog.CertificateViewAdapter {
-/* ownCloud Android client application
- * Copyright (C) 2012-2014 ownCloud Inc.
+/**
+ * ownCloud Android client application
+ *
+ * @author masensio
+ * @author David A. Velasco
+ * Copyright (C) 2015 ownCloud Inc.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2,
/**
* Dialog to show an Untrusted Certificate
- *
- * @author masensio
- * @author David A. Velasco
- *
*/
public class SslErrorViewAdapter implements SslUntrustedCertDialog.ErrorViewAdapter {
-/* ownCloud Android client application
- * Copyright (C) 2012-2014 ownCloud Inc.
+/**
+ * ownCloud Android client application
+ *
+ * @author masensio
+ * @author David A. Velasco
+ * Copyright (C) 2015 ownCloud Inc.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2,
import android.widget.TextView;
/**
- *
- * @author masensio
- * @author David A. Velasco
*
*/
public class X509CertificateViewAdapter implements SslUntrustedCertDialog.CertificateViewAdapter {
-/* ownCloud Android client application
- * Copyright (C) 2012-2013 ownCloud Inc.
+/**
+ * ownCloud Android client application
+ *
+ * Copyright (C) 2015 ownCloud Inc.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2,
-/* ownCloud Android client application
+/**
+ * ownCloud Android client application
+ *
* Copyright (C) 2012 Bartek Przybylski
- * Copyright (C) 2012-2013 ownCloud Inc.
+ * Copyright (C) 2015 ownCloud Inc.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2,
-/* ownCloud Android client application
+/**
+ * ownCloud Android client application
+ *
+ * @author Bartek Przybylski
* Copyright (C) 2012 Bartek Przybylski
- * Copyright (C) 2012-2013 ownCloud Inc.
+ * Copyright (C) 2015 ownCloud Inc.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2,
/**
* Dialog which will be displayed to user upon keep-in-sync file conflict.
- *
- * @author Bartek Przybylski
- *
*/
public class ConflictsResolveDialog extends SherlockDialogFragment {
-/* ownCloud Android client application
- * Copyright (C) 2014 ownCloud Inc.
+/**
+ * ownCloud Android client application
+ *
+ * @author David A. Velasco
+ * Copyright (C) 2015 ownCloud Inc.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2,
/**
* Dialog to input the name for a new folder to create.
*
- * Triggers the folder creation when name is confirmed.
- *
- * @author David A. Velasco
+ * Triggers the folder creation when name is confirmed.
*/
public class CreateFolderDialogFragment
extends SherlockDialogFragment implements DialogInterface.OnClickListener {
-/* ownCloud Android client application
- * Copyright (C) 2014 ownCloud Inc.
+/**
+ * ownCloud Android client application
+ *
+ * Copyright (C) 2015 ownCloud Inc.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2,
-/* ownCloud Android client application
- * Copyright (C) 2012-2013 ownCloud Inc.
+/**
+ * ownCloud Android client application
+ *
+ * Copyright (C) 2015 ownCloud Inc.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2,
-/* ownCloud Android client application
- * Copyright (C) 2012-2014 ownCloud Inc.
+/**
+ * ownCloud Android client application
+ *
+ * Copyright (C) 2015 ownCloud Inc.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2,
-/* ownCloud Android client application
- * Copyright (C) 2014 ownCloud Inc.
+/**
+ * ownCloud Android client application
+ *
+ * @author David A. Velasco
+ * Copyright (C) 2015 ownCloud Inc.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2,
/**
* Dialog requiring confirmation before removing a given OCFile.
*
- * Triggers the removal according to the user response.
- *
- * @author David A. Velasco
+ * Triggers the removal according to the user response.
*/
import java.util.Vector;
-/* ownCloud Android client application
+/**
+ * ownCloud Android client application
+ *
+ * @author David A. Velasco
* Copyright (C) 2014 ownCloud Inc.
*
* This program is free software: you can redistribute it and/or modify
/**
* Dialog to input a new name for a file or folder to rename.
*
- * Triggers the rename operation when name is confirmed.
- *
- * @author David A. Velasco
+ * Triggers the rename operation when name is confirmed.
*/
public class RenameFileDialogFragment
extends SherlockDialogFragment implements DialogInterface.OnClickListener {
-/* ownCloud Android client application
- * Copyright (C) 2012-2014 ownCloud Inc.
+/**
+ * ownCloud Android client application
+ *
+ * @author Maria Asensio
+ * @author David A. Velasco
+ * Copyright (C) 2015 ownCloud Inc.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2,
/**
* Dialog to show the WebView for SAML Authentication
- *
- * @author Maria Asensio
- * @author David A. Velasco
*/
public class SamlWebViewDialog extends SherlockDialogFragment {
-/* ownCloud Android client application
- * Copyright (C) 2012-2014 ownCloud Inc.
+/**
+ * ownCloud Android client application
+ *
+ * @author David A. Velasco
+ * Copyright (C) 2015 ownCloud Inc.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2,
/**
* Dialog showing a list activities able to resolve a given Intent,
* filtering out the activities matching give package names.
- *
- * @author David A. Velasco
*/
public class ShareLinkToDialog extends SherlockDialogFragment {
-/* ownCloud Android client application
- * Copyright (C) 2012-2014 ownCloud Inc.
+/**
+ * ownCloud Android client application
+ *
+ * @author masensio
+ * @author David A. Velasco
+ * Copyright (C) 2015 ownCloud Inc.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2,
* to decide trust on it or not.
*
* Abstract implementation of common functionality for different dialogs that
- * get the information about the error and the certificate from different classes.
- *
- * @author masensio
- * @author David A. Velasco
+ * get the information about the error and the certificate from different classes.
*/
public class SslUntrustedCertDialog extends SherlockDialogFragment {
-/* ownCloud Android client application
- * Copyright (C) 2012-2013 ownCloud Inc.
+/**
+ * ownCloud Android client application
+ *
+ * @author David A. Velasco
+ * Copyright (C) 2015 ownCloud Inc.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2,
/**
* Dialog to request the user about a certificate that could not be validated with the certificates store in the system.
- *
- * @author David A. Velasco
*/
public class SslValidatorDialog extends Dialog {
-/* ownCloud Android client application
- * Copyright (C) 2012-2013 ownCloud Inc.
+/**
+ * ownCloud Android client application
+ *
+ * Copyright (C) 2015 ownCloud Inc.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2,
-/* ownCloud Android client application
+/**
+ * ownCloud Android client application
+ *
* Copyright (C) 2012 Bartek Przybylski
- * Copyright (C) 2012-2013 ownCloud Inc.
+ * Copyright (C) 2015 ownCloud Inc.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2,
-/* ownCloud Android client application
+/**
+ * ownCloud Android client application
+ *
* Copyright (C) 2012 Bartek Przybylski
- * Copyright (C) 2012-2013 ownCloud Inc.
+ * Copyright (C) 2015 ownCloud Inc.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2,
-/* ownCloud Android client application
+/**
+ * ownCloud Android client application
+ *
* Copyright (C) 2012 Bartek Przybylski
* Copyright (C) 2012-2015 ownCloud Inc.
*
-/* ownCloud Android client application
+/**
+ * ownCloud Android client application
+ *
+ * @author Bartek Przybylski
+ * @author David A. Velasco
* Copyright (C) 2011 Bartek Przybylski
- * Copyright (C) 2012-2013 ownCloud Inc.
+ * Copyright (C) 2015 ownCloud Inc.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2,
/**
* This Fragment is used to display the details about a file.
- *
- * @author Bartek Przybylski
- * @author David A. Velasco
*/
public class FileDetailFragment extends FileFragment implements OnClickListener {
/**
- * Helper class responsible for updating the progress bar shown for file uploading or downloading
- *
- * @author David A. Velasco
+ * Helper class responsible for updating the progress bar shown for file uploading or downloading
*/
private class ProgressListener implements OnDatatransferProgressListener {
int mLastPercent = 0;
-/* ownCloud Android client application
- * Copyright (C) 2012-2013 ownCloud Inc.
+/**
+ * ownCloud Android client application
+ *
+ * @author David A. Velasco
+ * Copyright (C) 2015 ownCloud Inc.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2,
/**
* Common methods for {@link Fragment}s containing {@link OCFile}s
- *
- * @author David A. Velasco
- *
*/
public class FileFragment extends SherlockFragment {
/**
* Interface to implement by any Activity that includes some instance of FileListFragment
* Interface to implement by any Activity that includes some instance of FileFragment
- *
- * @author David A. Velasco
*/
public interface ContainerActivity extends ComponentsGetter {
-/* ownCloud Android client application
+/**
+ * ownCloud Android client application
+ *
+ * @author David A. Velasco
* Copyright (C) 2011 Bartek Przybylski
- * Copyright (C) 2012-2013 ownCloud Inc.
+ * Copyright (C) 2015 ownCloud Inc.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2,
/**
* A Fragment that lists all files and folders in a given LOCAL path.
- *
- * @author David A. Velasco
- *
*/
public class LocalFileListFragment extends ExtendedListFragment {
private static final String TAG = "LocalFileListFragment";
/**
* Interface to implement by any Activity that includes some instance of LocalFileListFragment
- *
- * @author David A. Velasco
*/
public interface ContainerActivity {
-/* ownCloud Android client application
+/**
+ * ownCloud Android client application
+ *
+ * @author Bartek Przybylski
+ * @author masensio
+ * @author David A. Velasco
* Copyright (C) 2011 Bartek Przybylski
- * Copyright (C) 2012-2014 ownCloud Inc.
+ * Copyright (C) 2015 ownCloud Inc.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2,
* A Fragment that lists all files and folders in a given path.
*
* TODO refactorize to get rid of direct dependency on FileDisplayActivity
- *
- * @author Bartek Przybylski
- * @author masensio
- * @author David A. Velasco
*/
public class OCFileListFragment extends ExtendedListFragment {
-/* ownCloud Android client application
- *
- * Copyright (C) 2012-2013 ownCloud Inc.
+/**
+ * ownCloud Android client application
+ *
+ * @author David A. Velasco
+ * Copyright (C) 2015 ownCloud Inc.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2,
/**
* This Fragment is used to monitor the progress of a file downloading.
- *
- * @author David A. Velasco
*/
public class FileDownloadFragment extends FileFragment implements OnClickListener {
/**
- * Helper class responsible for updating the progress bar shown for file uploading or downloading
- *
- * @author David A. Velasco
+ * Helper class responsible for updating the progress bar shown for file uploading or downloading
*/
private class ProgressListener implements OnDatatransferProgressListener {
int mLastPercent = 0;
-/* ownCloud Android client application
- * Copyright (C) 2012-2013 ownCloud Inc.
+/**
+ * ownCloud Android client application
+ *
+ * @author David A. Velasco
+ * Copyright (C) 2015 ownCloud Inc.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2,
/**
* Holds a swiping galley where image files contained in an ownCloud directory are shown
- *
- * @author David A. Velasco
*/
public class PreviewImageActivity extends FileActivity implements
FileFragment.ContainerActivity,
-/* ownCloud Android client application
- * Copyright (C) 2012-2014 ownCloud Inc.
+/**
+ * ownCloud Android client application
+ *
+ * @author David A. Velasco
+ * Copyright (C) 2015 ownCloud Inc.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2,
import com.owncloud.android.ui.dialog.RemoveFileDialogFragment;
import com.owncloud.android.ui.fragment.FileFragment;
import com.owncloud.android.utils.BitmapUtils;
-import com.owncloud.android.utils.TouchImageViewCustom;
+import third_parties.michaelOrtiz.TouchImageViewCustom;
/**
* Trying to get an instance with NULL {@link OCFile} or ownCloud {@link Account} values will produce an {@link IllegalStateException}.
*
* If the {@link OCFile} passed is not downloaded, an {@link IllegalStateException} is generated on instantiation too.
- *
- * @author David A. Velasco
*/
public class PreviewImageFragment extends FileFragment {
-/* ownCloud Android client application
- * Copyright (C) 2012-2013 ownCloud Inc.
+/**
+ * ownCloud Android client application
+ *
+ * @author David A. Velasco
+ * Copyright (C) 2015 ownCloud Inc.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2,
import com.owncloud.android.utils.FileStorageUtils;
/**
- * Adapter class that provides Fragment instances
- *
- * @author David A. Velasco
+ * Adapter class that provides Fragment instances
*/
//public class PreviewImagePagerAdapter extends PagerAdapter {
public class PreviewImagePagerAdapter extends FragmentStatePagerAdapter {
-/* ownCloud Android client application
- * Copyright (C) 2012-2013 ownCloud Inc.
+/**
+ * ownCloud Android client application
+ *
+ * @author David A. Velasco
+ * Copyright (C) 2015 ownCloud Inc.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2,
* Trying to get an instance with NULL {@link OCFile} or ownCloud {@link Account} values will produce an {@link IllegalStateException}.
*
* By now, if the {@link OCFile} passed is not downloaded, an {@link IllegalStateException} is generated on instantiation too.
- *
- * @author David A. Velasco
*/
public class PreviewMediaFragment extends FileFragment implements
OnTouchListener {
-/* ownCloud Android client application
- * Copyright (C) 2012-2013 ownCloud Inc.
+/**
+ * ownCloud Android client application
+ *
+ * @author David A. Velasco
+ * Copyright (C) 2015 ownCloud Inc.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2,
* Used as an utility to preview video files contained in an ownCloud account.
*
* Currently, it always plays in landscape mode, full screen. When the playback ends,
- * the activity is finished.
- *
- * @author David A. Velasco
+ * the activity is finished.
*/
public class PreviewVideoActivity extends FileActivity implements OnCompletionListener, OnPreparedListener, OnErrorListener {
-/* ownCloud Android client application
- * Copyright (C) 2012-2014 ownCloud Inc.
+/**
+ * ownCloud Android client application
+ *
+ * @author David A. Velasco
+ * Copyright (C) 2015 ownCloud Inc.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2,
/**
* Utility class with methods for decoding Bitmaps.
- *
- * @author David A. Velasco
*/
public class BitmapUtils {
-/* ownCloud Android client application\r
+/**\r
+ * ownCloud Android client application\r
+ *\r
+ * @author Bartek Przybylski\r
+ * @author David A. Velasco\r
* Copyright (C) 2011 Bartek Przybylski\r
- * Copyright (C) 2012-2013 ownCloud Inc.\r
+ * Copyright (C) 2015 ownCloud Inc.\r
*\r
* This program is free software: you can redistribute it and/or modify\r
* it under the terms of the GNU General Public License version 2,\r
\r
/**\r
* A helper class for some string operations.\r
- * \r
- * @author Bartek Przybylski\r
- * @author David A. Velasco\r
*/\r
public class DisplayUtils {\r
\r
-/* ownCloud Android client application
+/**
+ * ownCloud Android client application
+ *
+ * @author masensio
* Copyright (C) 2014 ownCloud Inc.
*
* This program is free software: you can redistribute it and/or modify
import com.owncloud.android.operations.UploadFileOperation;
/**
- * Class to choose proper error messages to show to the user depending on the results of operations, always following the same policy
- *
- * @author masensio
- *
+ * Class to choose proper error messages to show to the user depending on the results of operations,
+ * always following the same policy
*/
public class ErrorMessageAdapter {
-/* ownCloud Android client application
- * Copyright (C) 2012-2013 ownCloud Inc.
+/**
+ * ownCloud Android client application
+ *
+ * @author David A. Velasco
+ * Copyright (C) 2015 ownCloud Inc.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2,
/**
* Static methods to help in access to local file system.
- *
- * @author David A. Velasco
*/
public class FileStorageUtils {
public static Integer mSortOrder;
-/* ownCloud Android client application\r
+/**\r
+ * ownCloud Android client application\r
+ *\r
+ * @author Bartek Przybylski\r
* Copyright (C) 2011 Bartek Przybylski\r
- * Copyright (C) 2012-2013 ownCloud Inc.\r
+ * Copyright (C) 2015 ownCloud Inc.\r
*\r
* This program is free software: you can redistribute it and/or modify\r
* it under the terms of the GNU General Public License version 2,\r
\r
/**\r
* Represents a session to an ownCloud instance\r
- * \r
- * @author Bartek Przybylski\r
- * \r
*/\r
public class OwnCloudSession {\r
private String mSessionName;\r
-/* ownCloud Android client application
+/**
+ * ownCloud Android client application
+ *
* Copyright (C) 2012 Bartek Przybylski
- * Copyright (C) 2012-2013 ownCloud Inc.
+ * Copyright (C) 2015 ownCloud Inc.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2,
+++ /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
-/* ownCloud Android client application
- * Copyright (C) 2012-2014 ownCloud Inc.
+/**
+ * ownCloud Android client application
+ *
+ * Copyright (C) 2015 ownCloud Inc.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2,
-/* ownCloud Android client application
+/**
+ * ownCloud Android client application
+ *
* Copyright (C) 2012 Bartek Przybylski
- * Copyright (C) 2012-2013 ownCloud Inc.
+ * Copyright (C) 2015 ownCloud Inc.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2,
--- /dev/null
+/**
+ * @author Michael Ortiz
+ * @updated Patrick Lackemacher
+ * @updated Babay88
+ * @updated @ipsilondev
+ * @updated hank-cp
+ * @updated singpolyma
+ * Copyright (c) 2012 Michael Ortiz
+ */
+
+package third_parties.michaelOrtiz;
+
+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;
+
+/**
+ * Extends Android ImageView to include pinch zooming, panning, fling and double tap zoom.
+ */
+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 img
+ */
+ 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
-/* ownCloud Android client application
+/**
+ * ownCloud Android client application
+ *
* Copyright (C) 2012 Bartek Przybylski
- * Copyright (C) 2012-2013 ownCloud Inc.
+ * Copyright (C) 2015 ownCloud Inc.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2,