From f48b0df2f963f2dd27012c5acfb315f0ba77eca5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20Sch=C3=BCller?= Date: Mon, 1 Jun 2020 20:28:02 +0200 Subject: [PATCH 01/50] Translations (#163) * Translated using Weblate (Italian) Currently translated at 100.0% (323 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/it/ * Translated using Weblate (Chinese (Simplified)) Currently translated at 38.7% (125 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/zh_Hans/ * Translated using Weblate (French) Currently translated at 100.0% (323 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/fr/ * Translated using Weblate (Chinese (Simplified)) Currently translated at 48.0% (155 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/zh_Hans/ * Translated using Weblate (German) Currently translated at 100.0% (323 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/de/ * Translated using Weblate (French) Currently translated at 100.0% (323 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/fr/ * Translated using Weblate (Russian) Currently translated at 99.3% (321 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/ru/ * Translated using Weblate (Russian) Currently translated at 99.3% (321 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/ru/ * Translated using Weblate (Bengali) Currently translated at 99.3% (321 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/bn/ * Translated using Weblate (Spanish) Currently translated at 42.1% (136 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/es/ * Translated using Weblate (Bengali) Currently translated at 100.0% (323 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/bn/ * Translated using Weblate (Bengali) Currently translated at 99.6% (322 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/bn/ * Translated using Weblate (Persian) Currently translated at 40.2% (130 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/fa/ * Translated using Weblate (Bengali) Currently translated at 99.6% (322 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/bn/ * Translated using Weblate (Bengali) Currently translated at 99.6% (322 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/bn/ * Translated using Weblate (Bengali) Currently translated at 99.6% (322 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/bn/ * Translated using Weblate (Bengali) Currently translated at 100.0% (323 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/bn/ * Translated using Weblate (Polish) Currently translated at 100.0% (323 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/pl/ * Translated using Weblate (Polish) Currently translated at 100.0% (323 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/pl/ * Translated using Weblate (Russian) Currently translated at 100.0% (323 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/ru/ * update library and more (#160) * download files with friendly name (not video ID) * Update Picasso library FIX : add extension in downloaded filename. download files with friendly name (not video ID) * Update Gradle Add 0.75x and 1.25x to play speed * Release v1.0.35 Co-authored-by: Michael Moroni Co-authored-by: mostkai Co-authored-by: B0pol Co-authored-by: Jeannette L Co-authored-by: Nathan Co-authored-by: Mihail Iosilevitch Co-authored-by: anonymous Co-authored-by: Oymate Co-authored-by: Juanro49 Co-authored-by: Mostafa Ahangarha Co-authored-by: Szylu Co-authored-by: Artem Co-authored-by: jmgfr <13685004+jmgfr@users.noreply.github.com> Co-authored-by: Stefan Schueller --- app/src/main/res/values-bn/strings.xml | 169 ++++++------- app/src/main/res/values-de/strings.xml | 2 +- app/src/main/res/values-es/strings.xml | 4 + app/src/main/res/values-fa/strings.xml | 65 +++++ app/src/main/res/values-fr/strings.xml | 7 +- app/src/main/res/values-it/strings.xml | 2 +- app/src/main/res/values-pl/strings.xml | 270 ++++++++++++++++++++- app/src/main/res/values-ru/strings.xml | 9 +- app/src/main/res/values-zh-rCN/strings.xml | 36 ++- 9 files changed, 465 insertions(+), 99 deletions(-) diff --git a/app/src/main/res/values-bn/strings.xml b/app/src/main/res/values-bn/strings.xml index 366cf0c..66af05e 100644 --- a/app/src/main/res/values-bn/strings.xml +++ b/app/src/main/res/values-bn/strings.xml @@ -14,90 +14,93 @@ পাসওয়ার্ড খুব ছোট ভুল পাসওয়ার্ড এটি জরুরি ফিল্ড - Grant contact permission for email completion. + ই-মেইল পূরণ করার জন্য কন্টাক্ট-এর অনুমতি দিন। সার্চ সেটিং লগ আউট হোম - "Trending" - Subscriptions + আলোচিত + সাবস্ক্রিপশন একাউন্ট 1.0.0-alpha.7 https://troll.tv - PeerTube Server + পিয়ারটিউব সার্ভার \u0020-\u0020 \u0020Views \@ - Video Thumbnail + ভিডিও থাম্বনেল Account Avatar - NSFW দেখাও - NSFW content will be shown if enabled. - ভাষা ফিলটার + নিষিদ্ধ কন্টেন্ট + নিষিদ্ধ কন্টেন্ট দেখাও + ভাষা ফিল্টার ভিডিওর ভাষা পছন্দ করুন, কিছু পছন্দ না করলে সব ভাষার ভিডিও দেখা যাবে. - UrlVideoPlayActivity - Torrent Video Player - Video playback via a torrent stream. This requires Storage Permissions. (Alpha, not stable!) + ইউআরএলভিডিওপ্লেঅ্যাক্টিভিটি + টরেন্ট ভিডিও প্লেয়ার + একটি টরেন্ট স্ট্রিম মাধ্যমে ভিডিও প্লেব্যাক করুন। এর জন্য স্টোরেজ অনুমতির প্রয়োজন । (আলফা, স্থিতিশীল নয়!) লাইসেন্স - \nGNU Affero General Public License v3.0\n\nPermissions of this strongest copyleft license are conditioned on making available complete source code of licensed works and modifications, which include larger works using a licensed work, under the same license. Copyright and license notices must be preserved. Contributors provide an express grant of patent rights. When a modified version is used to provide a service over a network, the complete source code of the modified version must be made available. - ভার্সন - সার্চ PeerTube + +\nগাহ্নু অফেরও সাধারণ গণ অনুমতিপত্র সং.৩.০ +\n +\nএই শক্তিশালী কপিলেফট লাইসেন্সের অনুমতি এই চুক্তির উপর নির্ভরশীল যে অনুমতিপত্রের দ্বারা আবদ্ধ সকল কাজ ও পরিবর্তনের সোর্স কোড উপলব্ধ করার মাধ্যমে, যার আওতায় পড়ে অনুমতিপত্রের দ্বারা আবদ্ধ কাজের বৃহত্তর অংশ একই অনুমতিপত্রের আওতায় আনার মাধ্যমে। কপিরাইট এবং লাইসেন্স নোটিশ সংরক্ষণ করা আবশ্যক। অবদানকারীগণ তাদের পেটেন্টর অধিকার অবশ্যই দেয়, যখন একটি পরিমার্জিত সংস্করণ ব্যবহার করে একটি পরিসেবা একটি নেটওয়ার্ক দিয়ে দেয়া হয়, সম্পূর্ণ সোর্স কোড এর পরিমার্জিত সংস্করণ উপলব্ধ তৈরি করা আবশ্যক। + সংস্করণ + সার্চ পিয়ারটিউব সার্চ " কোন উত্তর নেই" আরও শেয়ার PeerTube - Invalid URL. + অবৈধ ইউআরএল। ডার্ক মোড - Restart App for Dark Mode to take effect. - App Theme - Restart app for theme to take effect. - Abkhazian - Afar - Afrikaans - Akan - Albanian - American Sign Language - Amharic - Arabic - Aragonese - Armenian - Assamese - Avaric - Aymara - Azerbaijani - Bambara - Bashkir - Basque - Belarusian + ডার্ক মোড কার্যকর করার জন্য অ্যাপ্লিকেশন রিস্টার্ট করুন। + অ্যাপ থিম + থিমটি কার্যকর হওয়ার জন্য অ্যাপ্লিকেশন পুনরায় চালু করুন। + আবখাজিয়ান + আফার + আফ্রিকান + আকান + আলবানিয়ান + আমেরিকান সাইন ভাষা + আমহারিক + আরবি + আরাগনিস + আর্মেনিয়ান + অসমি + অভরিক + আয়মারা + আজারবাইজান + বাম্বারা + বাশকির + বাস্ক + বেলারুসিয়ান বাংলা - Bislama - Bosnian - Brazilian Sign Language - Breton - British Sign Language - Bulgarian - Burmese - Catalan - Chamorro - Chechen - Chinese - Chinese Sign Language - Chuvash - Cornish - Corsican - Cree - Croatian - Czech - Czech Sign Language - Danish - Danish Sign Language - Dhivehi - Dutch - Dzongkha + বিসলামা + বসনিয়ান + ব্রাজিলিয়ান সাইন ভাষা + ব্রেটন + ব্রিটিশ সাইন ভাষা + বুলগারিয়ানে + বার্মিজ + কাটালান + চামোরো + চেচেন + চাইনিজ + চীনা সাইন ভাষা + চুভাশ + কর্ণিশ + কোর্সিকান + ক্রি + ক্রোয়েশীয় + চেক + চেক সাইন ভাষা + ড্যানিশ + ড্যানিশ সাংকেতিক ভাষা + ধিভেসি + ডাচ্ + জংখ্যা ইংলিশ Esperanto Estonian @@ -106,13 +109,13 @@ Fijian Finnish French - French Sign Language + ফরাসি সাংকেতিক ভাষা Fulah Galician Ganda Georgian German - German Sign Language + জার্মান সাংকেতিক ভাষা Guarani Gujarati Haitian @@ -130,7 +133,7 @@ Irish Italian Japanese - Japanese Sign Language + জাপানি সাইন ভাষা Javanese Kalaallisut Kannada @@ -182,7 +185,7 @@ Oriya (macrolanguage) Oromo Ossetian - Pakistan Sign Language + পাকিস্তানি সাংকেতিক ভাষা Panjabi Persian Polish @@ -193,11 +196,11 @@ Romansh Rundi Russian - Russian Sign Language + রাশিয়ান সাংকেতিক ভাষা Samoan Sango Sardinian - Saudi Arabian Sign Language + সৌদি আরবীয় সাংকেতিক ভাষা Scottish Gaelic Serbian Serbo-Croatian @@ -208,7 +211,7 @@ Slovak Slovenian Somali - South African Sign Language + দক্ষিণ আফ্রিকান সাংকেতিক ভাষা South Ndebele Southern Sotho Spanish @@ -216,7 +219,7 @@ Swahili (macrolanguage) Swati Swedish - Swedish Sign Language + সুইডিশ সাংকেতিক ভাষা Tagalog Tahitian Tajik @@ -253,18 +256,18 @@ Indigo নীল হালকা নীল - Cyan - Teal + হালকা সবজে নীল + সবজে নীল সবুজ হালকা সবুজ - Lime + হালকা সবুজ হলুদ - Amber + কমলা-হলুদ কমলা - Deep Orange + গাড় কমলা বাদামী ধুসর - Bluegray + নীলচে ধূসর 0.5x Normal 1.5x @@ -278,20 +281,20 @@ {faw-share} {faw-download} {faw-save} - Background Playback - If enabled, continues to play video in background. + ব্যাকগ্রাউন্ড প্লেব্যাক + সক্রিয় থাকলে ব্যাকগ্রাউন্ডে ভিডিও প্লে করতে থাকুন। Local একাউন্ট রিপোর্ট - Blacklist - Can not download video without write permission - Rating Failed + নিষিদ্ধ তালিকা + লেখার অনুমতি ছাড়া ভিডিও ডাউনলোড করা যাবে না + রেটিং ব্যর্থ এই সেবা ব্যবহারের জন্য লগ ইন করুন শেয়ার ডাউনলোড Privacy - Category - License + বিভাগ + অনুমতিপত্র ভাষা Tags @@ -322,6 +325,10 @@ না পিয়ারটিউব সার্ভার URL সার্ভার নির্বাচন করুন + সেট করা সার্ভার: %s + সাইন আপ করা যাবে: %s + বর্তমান সার্ভার + নিচের তালিকা থেকে একটি সার্ভার নিন অথবা সরাসরি একটি সার্ভার দিন। 0.75x 1.25x \ No newline at end of file diff --git a/app/src/main/res/values-de/strings.xml b/app/src/main/res/values-de/strings.xml index 70c10b4..9eb1cf9 100644 --- a/app/src/main/res/values-de/strings.xml +++ b/app/src/main/res/values-de/strings.xml @@ -3,7 +3,7 @@ Einstellungen Anmelden Server - Kontoname + E-Mail / Kontoname Passwort Anmelden Anmelden diff --git a/app/src/main/res/values-es/strings.xml b/app/src/main/res/values-es/strings.xml index 2ab7719..80ec33d 100644 --- a/app/src/main/res/values-es/strings.xml +++ b/app/src/main/res/values-es/strings.xml @@ -107,4 +107,8 @@ Se unió: Algo salió mal, por favor inténtalo más tarde! Seleccionar servidor + +\nGNU Affero General Public License v3.0 +\n +\nLos permisos de esta fuerte licencia copyleft están condicionados a hacer disponible el código fuente completo de los trabajos licenciados y las modificaciones, que incluyen trabajos más grandes usando un trabajo licenciado, bajo la misma licencia. Los derechos de autor y los avisos de licencia deben ser preservados. Los colaboradores proporcionan una concesión expresa de los derechos de patente. Cuando se utiliza una versión modificada para proporcionar un servicio a través de una red, el código fuente completo de la versión modificada debe estar disponible. \ No newline at end of file diff --git a/app/src/main/res/values-fa/strings.xml b/app/src/main/res/values-fa/strings.xml index ae4738e..c4c5018 100644 --- a/app/src/main/res/values-fa/strings.xml +++ b/app/src/main/res/values-fa/strings.xml @@ -41,4 +41,69 @@ صافی زبان کارساز پیرتیوب پخش در پس‌زمینه + گزارش + حساب + نشانی کارساز پیرتیوب + کارسازی را از سیاهه زیر انتخاب کرده یا مستقیم وارد کنید. + بله + باز بودن نام‌نویسی: %s + انتخاب کارساز + عادی + آبی‌خاکستری + خاکستری + قهوه‌ای + نارنجی تیره + نارنجی + زرد + لیمویی + سبز روشن + سبز + فیرزه‌ای + آبی روشن + آبی + ازبکی + اردو + اوکراینی + ترکمنی + ترکی + روسی + رومانیایی + پشتو + پرتغالی + مجاری + لهستانی + فارسی + پنجابی + مراتی + کوردی + کره‌ای + کشمیری + ژاپنی + ایتالیایی + ایرلندی + اندونزیایی + هندی + عبری + گجراتی + آلمانی + فرانسوی + فنلاندی + انگلیسی + + دانمارکی + چینی + بلغاری + بوسنیایی + بنگالی + آذربایجانی + ارمنی + عربی + در صورت فعال بودن، پخش ویدئو در پس‌زمینه ادامه می‌یابد. + به جای نشان دادن همه ویدئه تحت همه زبان‌ها، یک زبان برای ویدئو انتخاب کنید. + +\nپروانه عمومی همگانی آفرو نسخه ۳ AGPLv3 +\n +\nمجوزهای این پروانه که قوی‌ترین پروانه کپی‌لفت است مشروط به دردسترس قرار دادن کامل کد منبع کارهای تحت پروانه و نسخه‌های تغییریافته‌شان است که شامل کارهای بزرگ‌تری که تحت همین پروانه × از این کار استفاده می‌کنند می‌شود. تذکر پروانه و کپی‌رایت باید محفوظ بماند. مشارکت‌کنندگان باید واگذاری حقوق پتنت را اعلام کنند. وقتی نسخه تغییر یافته برای ارائه خدمت روی شبکه استفاده شود، کد منبع نسخه تغییر یافته بایستی به صورت کامل دردسترس قرار بگیرد. + پخش ویدئو از طریق جریان تورنت. این ویژگی، نیازمند مجور دسترسی به فضای ذخیره‌سازی است. (آلفا، ناپایدار!) + نوار ناوبری پایین \ No newline at end of file diff --git a/app/src/main/res/values-fr/strings.xml b/app/src/main/res/values-fr/strings.xml index fa70f15..5a41a78 100644 --- a/app/src/main/res/values-fr/strings.xml +++ b/app/src/main/res/values-fr/strings.xml @@ -39,10 +39,7 @@ Lecteur vidéo torrent Lecture de vidéo via un flux torrent. Ceci requiert les permissions de stockage. (Alpha, instable !) Licence - -\nGNU Affero General Public License v3.0 -\n -\nLes autorisations de cette licence de copyleft la plus forte sont conditionnées à la mise à disposition d\'un code source complet des œuvres sous licence et des modifications, qui comprennent des œuvres plus grandes utilisant une œuvre sous licence, sous la même licence. Les avis de droit d\'auteur et de licence doivent être conservés. Les contributeurs accordent expressément des droits de brevet. Lorsqu\'une version modifiée est utilisée pour fournir un service sur un réseau, le code source complet de la version modifiée doit être mis à disposition. + Strings related to login Version Rechercher sur PeerTube Rechercher @@ -101,7 +98,7 @@ Vous devez vous connecter pour utiliser ce service Partager Télécharger - Vie privée + Confidentialité Catégorie Licence Langue diff --git a/app/src/main/res/values-it/strings.xml b/app/src/main/res/values-it/strings.xml index a473cb6..13eb06f 100644 --- a/app/src/main/res/values-it/strings.xml +++ b/app/src/main/res/values-it/strings.xml @@ -49,7 +49,7 @@ Modo scuro \nGNU Affero General Public License v3.0 -\n +\n \nLe autorizzazioni di questa licenza copyleft più forte sono condizionate a rendere disponibile il codice sorgente completo delle opere concesse in licenza e delle modifiche, che includono opere più grandi utilizzando un lavoro concesso in licenza, sotto la stessa licenza. Le note di copyright e di licenza devono essere conservate. I contributori forniscono una concessione espressa dei diritti di brevetto. Quando si utilizza una versione modificata per fornire un servizio in rete, è necessario rendere disponibile il codice sorgente completo della versione modificata. abcaso afar diff --git a/app/src/main/res/values-pl/strings.xml b/app/src/main/res/values-pl/strings.xml index dd62007..7519f23 100644 --- a/app/src/main/res/values-pl/strings.xml +++ b/app/src/main/res/values-pl/strings.xml @@ -31,9 +31,271 @@ Więcej Udostępnij Nieprawidłowy URL. - Tryb Ciemny - Uruchom ponownie by Tryb Ciemny został włączony. - Motyw Aplikacji + Tryb ciemny + Uruchom ponownie by Tryb ciemny został włączony. + Motyw aplikacji Uruchom ponownie by zmiany motywu były widoczne. - Odtwarzacz filmów torrent + Torrentowy odtwarzacz filmów + O programie + Akan + Afar + Aktualny serwer + Wybierz serwer + Coś poszło nie tak, spróbuj później! + Dołączył: + Opis: + Subskrybujący: + Konto: + Kanały + Filmy + Jakość + Prędkość odtwarzania + Znaczniki + Język + Licencja + Kategoria + Prywatność + Pobierz + Udostępnij + Musisz się zalogować aby skorzystać z tej usługi + Ocena nieudana + Nie można pobrać wideo bez zgody zapisu + Czarna lista + Zgłoś + Konto + URL serwera PeerTube + Wybierz serwer z poniższej listy lub wprowadź go bezpośrednio. + Serwer ustawiony na: %s + Nie + Tak + Rejestracja dozwolona: %s + Wybierz serwer + 2x + 1.5x + Normalny + 0.5x + Szaroniebieski + Szary + Brązowy + Głęboki pomarańczowy + Pomarańczowy + Bursztynowy + Żółty + Limonkowy + Jasny zielony + Zielony + Morski + Cyjan + Jasny niebieski + Niebieski + Indygo + Głęboki fiolet + Fioletowy + Różowy + Czerwony + Zulu + Zhuang + Joruba + Jidysz + Xhosa + Wolof + Zachodniofryzyjski + Walijski + Waloński + Wietnamski + Venda + Uzbecki + Urdu + Ukraiński + Ujgurski + Twi + Turkmeński + Turecki + Tswana + Tsonga + Tonga (Wyspy Tonga) + Tigrinia + Tybetański + Tajski + Telugu + Tatarski + Tamilski + Tadżycki + Tahitański + Tagalski + Szwedzki język migowy + Szwedzki + Suazi + Suahili (makrojęzyk) + Sundajski + Hiszpański + Sotho + Ndebele południowy + Południowoafrykański język migowy + Somalijski + Słoweński + Słowacki + Syngaleski + Sindhi + Nuosu + Shona + Serbsko-chorwacki + Serbski + Gaelicki szkocki + Saudyjski język migowy + Sardyński + Sango + Samoański + Rosyjski język migowy + Rosyjski + Rundi + Romansz + Rumuński + Keczua + Paszto + Portugalski + Polski + Perski + Pendżabski + Pakistański język migowy + Osetyjski + Oromo + Orija (makrojęzyk) + Odżibwe + Oksytański + Czewa + Norweski Nynorsk + Norweski Bokmål + Norweski + Północnosaamski + Ndebele północny + Nepalski (makrojęzyk) + Ndonga + Nawaho + Nauruański + Mongolski + Nowogrecki (1453-) + Marszalski + Marathi + Maoryski + Manx + Maltański + Malayalam + Malajski (makrojęzyk) + Malgaski + Macedoński + Luksemburski + Luba-Katanga + Lojban + Litewski + Lingala + Limburski + Łotewski + Laotański + Kurdyjski + Kwanyama + Kotava + Koreański + Kongo + Komi + Klingoński + Kirgijski + Rwanda + Kikuju + Kmerski + Kazachski + Kaszmirski + Kanuri + Kannada + Grenlandzki + Jawajski + Japoński język migowy + Japoński + Włoski + Irlandzki + Inupiak + Inuktitut + Indonezyjski + Igbo + Islandzki + Węgierski + Hiri Motu + Hindi + Herero + Hebrajski + Hausa + Haitański + Gudźarati + Guarani + Niemiecki język migowy + Niemiecki + Gruziński + Luganda + Galicyjski + Ful + Francuski język migowy + Francuski + Fiński + Fidżyjski + Farerski + Ewe + Estoński + Esperanto + Angielski + Dzongkha + Niderlandzki + Malediwski + Duński język migowy + Duński + Czeski język migowy + Czeski + Chorwacki + Kri + Korsycki + Kornijski + Czuwaski + Chiński język migowy + Chiński + Czeczeński + Chamorro + Kataloński + Birmański + Bułgarski + Brytyjski język migowy + Bretoński + Brazylijski język migowy + Bośniacki + Bislama + Bengalski + Białoruski + Baskijski + Baszkirski + Bambara + Azerski + Ajmarski + Awarski + Asamski + Armeński + Aragoński + Arabski + Amharski + Amerykański język migowy + Albański + Afrykanerski + Abchaski + Jeśli jest włączony, kontynuuje odtwarzanie wideo w tle. + Odtwarzanie w tle + Serwer PeerTube + Wybierz język filmów, zamiast pokazywać wszystkie filmy we wszystkich językach. + Filtr językowy + Pokaż zawartość NSFW + Zawartość NSFW + +\n Powszechna Licencja Publiczna GNU Affero v3.0 +\n +\nUprawnienia tej najsilniejszej licencji copyleft są uzależnione od udostępnienia pełnego kodu źródłowego licencjonowanych utworów i modyfikacji, które obejmują większe dzieła przy użyciu licencjonowanego dzieła, na tej samej licencji. Informacje o prawach autorskich i licencjach należy zachować. Autorzy zapewniają wyraźne przyznanie praw patentowych. Gdy zmodyfikowana wersja jest używana do świadczenia usługi przez sieć, należy udostępnić pełny kod źródłowy zmodyfikowanej wersji. + Odtwarzanie wideo przez strumień torrentów. Wymaga to uprawnień do przechowywania. (Alfa, niestabilny!) + Udziel pozwolenia na kontakt w celu uzupełnienia wiadomości e-mail. + Wersja + Licencja \ No newline at end of file diff --git a/app/src/main/res/values-ru/strings.xml b/app/src/main/res/values-ru/strings.xml index 1cd7232..ed659f3 100644 --- a/app/src/main/res/values-ru/strings.xml +++ b/app/src/main/res/values-ru/strings.xml @@ -12,7 +12,7 @@ Этот пароль слишком короткий Неверный пароль Это поле обязательно к заполнению - «Разрешения на контакты необходимы для отправки электронных писем». + Разрешите контакты для отправки электронных писем. Поиск Настройки @@ -28,14 +28,13 @@ Миниатюра видео Аватар Показ NSFW ( контекст сексуального характера) - Содержание NSFW ( контекст сексуального характера) будет показано, если включено + Показывать NSFW (контент сексуального характера) Фильтр языков Выберите язык видео, чтобы не показывались видео на всех языках. Торрент видео плеер Воспроизведение видео через торрент поток. Это требует разрешения на хранение. (Альфа, не стабильный!) Лицензия - - Универсальная общественная лицензия GNU Affero v3.0. Разрешения этой самой мощной лицензии с авторским левом обусловлены предоставлением полного исходного кода лицензированных произведений и модификаций, которые включают в себя более крупные произведения с использованием лицензированных произведений, по той же лицензии. Уведомления об авторских правах и лицензии должны быть сохранены. Авторы предоставляют явное предоставление патентных прав. Когда измененная версия используется для предоставления услуги по сети, должен быть доступен полный исходный код модифицированной версии. + Strings related to login Версия Поиск PeerTube Поиск @@ -300,4 +299,6 @@ Подписчики: Присоединились: Выберите сервер + Сервер: %s + UrlVideoPlayActivity \ No newline at end of file diff --git a/app/src/main/res/values-zh-rCN/strings.xml b/app/src/main/res/values-zh-rCN/strings.xml index f390210..dbba02c 100644 --- a/app/src/main/res/values-zh-rCN/strings.xml +++ b/app/src/main/res/values-zh-rCN/strings.xml @@ -32,7 +32,7 @@ 点亮按钮以显示成人内容 主题 重启应用该主题。 - 重启进入夜间模式 + 重启应用以使夜间模式生效。 夜间模式 URL错误。 琥珀色 @@ -58,7 +58,7 @@ 本地 帐号 按语言过滤 - 选择你使用的语言,不勾选时所有语言的视频都会显示 + 选择你使用的语言,而不是显示所有语言的视频。 使用种子播放 视频通过一个种子下载,此选项需要存储权限(实验阶段,不稳定!) 退出 @@ -70,7 +70,7 @@ 视频缩略图 账号头像 Url视频播放Activity - 出故障了,请稍候再试 + 出故障了,请稍候再试! 阿拉伯语 亚美尼亚语 孟加拉语 @@ -99,6 +99,36 @@ 语言 + 背景播放 + 为发送电子邮件授予联系人访问权限。 + 阿布哈兹语 + 若启用,则在背景继续播放影片。 + 举报 + 黑名单 + 在没有写入权限的情况下无法下载 + 评价失败 + 你必须登录后才能使用此服务 + 分享 + 隐私 + 类别 + 许可 + 标签 + 播放速度 + 画质 + 视频 + 频道 + 关于 + 账号: + 订阅者: + 描述: + 加入于: + 选择服务器 + 允许注册:%s + 服务器设定为:%s + 从下面的列表选择一个服务器或者手动输入。 + PeerTube 服务器 URL + 选择服务器 + 现在的服务器 0.75倍速 1.25倍速 \ No newline at end of file From 8af61b9086bb2fab9a7603259dd45caeb07318f7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20Sch=C3=BCller?= Date: Sun, 14 Jun 2020 18:32:28 +0200 Subject: [PATCH 02/50] Release 1.0.36 (#166) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Translated using Weblate (Italian) Currently translated at 100.0% (323 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/it/ * Translated using Weblate (Chinese (Simplified)) Currently translated at 38.7% (125 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/zh_Hans/ * Translated using Weblate (French) Currently translated at 100.0% (323 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/fr/ * Translated using Weblate (Chinese (Simplified)) Currently translated at 48.0% (155 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/zh_Hans/ * Translated using Weblate (German) Currently translated at 100.0% (323 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/de/ * Translated using Weblate (French) Currently translated at 100.0% (323 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/fr/ * Translated using Weblate (Russian) Currently translated at 99.3% (321 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/ru/ * Translated using Weblate (Russian) Currently translated at 99.3% (321 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/ru/ * Translated using Weblate (Bengali) Currently translated at 99.3% (321 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/bn/ * Translated using Weblate (Spanish) Currently translated at 42.1% (136 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/es/ * Translated using Weblate (Bengali) Currently translated at 100.0% (323 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/bn/ * Translated using Weblate (Bengali) Currently translated at 99.6% (322 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/bn/ * Translated using Weblate (Persian) Currently translated at 40.2% (130 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/fa/ * Translated using Weblate (Bengali) Currently translated at 99.6% (322 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/bn/ * Translated using Weblate (Bengali) Currently translated at 99.6% (322 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/bn/ * Translated using Weblate (Bengali) Currently translated at 99.6% (322 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/bn/ * Translated using Weblate (Bengali) Currently translated at 100.0% (323 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/bn/ * Translated using Weblate (Polish) Currently translated at 100.0% (323 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/pl/ * Translated using Weblate (Polish) Currently translated at 100.0% (323 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/pl/ * Translated using Weblate (Russian) Currently translated at 100.0% (323 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/ru/ * update library and more (#160) * download files with friendly name (not video ID) * Update Picasso library FIX : add extension in downloaded filename. download files with friendly name (not video ID) * Update Gradle Add 0.75x and 1.25x to play speed * Release v1.0.35 * try to fix 'cannot make a new request because the previous response ... ' error (#164) * Translations (#163) * Translated using Weblate (Italian) Currently translated at 100.0% (323 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/it/ * Translated using Weblate (Chinese (Simplified)) Currently translated at 38.7% (125 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/zh_Hans/ * Translated using Weblate (French) Currently translated at 100.0% (323 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/fr/ * Translated using Weblate (Chinese (Simplified)) Currently translated at 48.0% (155 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/zh_Hans/ * Translated using Weblate (German) Currently translated at 100.0% (323 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/de/ * Translated using Weblate (French) Currently translated at 100.0% (323 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/fr/ * Translated using Weblate (Russian) Currently translated at 99.3% (321 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/ru/ * Translated using Weblate (Russian) Currently translated at 99.3% (321 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/ru/ * Translated using Weblate (Bengali) Currently translated at 99.3% (321 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/bn/ * Translated using Weblate (Spanish) Currently translated at 42.1% (136 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/es/ * Translated using Weblate (Bengali) Currently translated at 100.0% (323 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/bn/ * Translated using Weblate (Bengali) Currently translated at 99.6% (322 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/bn/ * Translated using Weblate (Persian) Currently translated at 40.2% (130 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/fa/ * Translated using Weblate (Bengali) Currently translated at 99.6% (322 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/bn/ * Translated using Weblate (Bengali) Currently translated at 99.6% (322 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/bn/ * Translated using Weblate (Bengali) Currently translated at 99.6% (322 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/bn/ * Translated using Weblate (Bengali) Currently translated at 100.0% (323 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/bn/ * Translated using Weblate (Polish) Currently translated at 100.0% (323 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/pl/ * Translated using Weblate (Polish) Currently translated at 100.0% (323 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/pl/ * Translated using Weblate (Russian) Currently translated at 100.0% (323 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/ru/ * update library and more (#160) * download files with friendly name (not video ID) * Update Picasso library FIX : add extension in downloaded filename. download files with friendly name (not video ID) * Update Gradle Add 0.75x and 1.25x to play speed * Release v1.0.35 Co-authored-by: Michael Moroni Co-authored-by: mostkai Co-authored-by: B0pol Co-authored-by: Jeannette L Co-authored-by: Nathan Co-authored-by: Mihail Iosilevitch Co-authored-by: anonymous Co-authored-by: Oymate Co-authored-by: Juanro49 Co-authored-by: Mostafa Ahangarha Co-authored-by: Szylu Co-authored-by: Artem Co-authored-by: jmgfr <13685004+jmgfr@users.noreply.github.com> Co-authored-by: Stefan Schueller * try to fix 'cannot make a new request because the previous response is still open' when login. Co-authored-by: Stefan Schüller Co-authored-by: Michael Moroni Co-authored-by: mostkai Co-authored-by: B0pol Co-authored-by: Jeannette L Co-authored-by: Nathan Co-authored-by: Mihail Iosilevitch Co-authored-by: anonymous Co-authored-by: Oymate Co-authored-by: Juanro49 Co-authored-by: Mostafa Ahangarha Co-authored-by: Szylu Co-authored-by: Artem Co-authored-by: jmgfr <13685004+jmgfr@users.noreply.github.com> Co-authored-by: Stefan Schueller * Release 1.0.36 Co-authored-by: Michael Moroni Co-authored-by: mostkai Co-authored-by: B0pol Co-authored-by: Jeannette L Co-authored-by: Nathan Co-authored-by: Mihail Iosilevitch Co-authored-by: anonymous Co-authored-by: Oymate Co-authored-by: Juanro49 Co-authored-by: Mostafa Ahangarha Co-authored-by: Szylu Co-authored-by: Artem Co-authored-by: jmgfr <13685004+jmgfr@users.noreply.github.com> Co-authored-by: Stefan Schueller Co-authored-by: lishoujun --- CHANGELOG.md | 4 ++++ app/build.gradle | 4 ++-- .../peertube/network/AuthorizationInterceptor.java | 8 +++++--- 3 files changed, 11 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0939ec1..638ec4d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +### Version 1.0.36 Tag: v1.0.36 (2020-06-14) + * fix 'cannot make a new request because the previous response (@lishoujun) + * Various translations + ### Version 1.0.35 Tag: v1.0.35 (2020-06-01) * Gradle und Lib updates (Android Studio 4) (@jmgfr) * Friendly name for downloaded files (@jmgfr) diff --git a/app/build.gradle b/app/build.gradle index 5062d0a..3844e9c 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -6,8 +6,8 @@ android { applicationId "net.schueller.peertube" minSdkVersion 21 targetSdkVersion 28 - versionCode 1035 - versionName "1.0.35" + versionCode 1036 + versionName "1.0.36" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" ext { libVersions = [ diff --git a/app/src/main/java/net/schueller/peertube/network/AuthorizationInterceptor.java b/app/src/main/java/net/schueller/peertube/network/AuthorizationInterceptor.java index 37786c7..37ba18f 100644 --- a/app/src/main/java/net/schueller/peertube/network/AuthorizationInterceptor.java +++ b/app/src/main/java/net/schueller/peertube/network/AuthorizationInterceptor.java @@ -37,8 +37,7 @@ public class AuthorizationInterceptor implements Interceptor { public Response intercept(Chain chain) throws IOException { Session session = Session.getInstance(); - - Response mainResponse = chain.proceed(chain.request()); + Response mainResponse; Request mainRequest = chain.request(); if (session.isLoggedIn()) { @@ -49,7 +48,8 @@ public class AuthorizationInterceptor implements Interceptor { // Log.v("Authorization", "Intercept: " + session.getToken()); // build request - mainResponse = chain.proceed(builder.build()); + Request req = builder.build(); + mainResponse = chain.proceed(req); // logout on auth error if (mainResponse.code() == 401 || mainResponse.code() == 403) { @@ -57,6 +57,8 @@ public class AuthorizationInterceptor implements Interceptor { Log.v("Authorization", "Intercept: Logout forced"); } + }else{ + mainResponse = chain.proceed(chain.request()); } return mainResponse; From 299de50b02611c912a7d9f7db3124667c5712e5e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Allan=20Nordh=C3=B8y?= Date: Wed, 17 Jun 2020 10:22:07 +0000 Subject: [PATCH 03/50] Translated using Weblate (Arabic) Currently translated at 100.0% (323 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/ar/ --- app/src/main/res/values-ar/strings.xml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/src/main/res/values-ar/strings.xml b/app/src/main/res/values-ar/strings.xml index c36c3a6..f55f858 100644 --- a/app/src/main/res/values-ar/strings.xml +++ b/app/src/main/res/values-ar/strings.xml @@ -42,9 +42,9 @@ تشغيل الفيديو عبر بث التورنت . يتطلب أذونات التخزين. (ألفا ، غير مستقر!) الرخصة - رخصة جنو العمومية v3.0\n - \n - إن أذونات هذا الترخيص الأقوى للحقوق المتروكة مشروطة بإتاحة الشفرة المصدرية الكاملة للأعمال والتعديلات المرخصة ، والتي تشتمل على أعمال أكبر باستخدام عمل مرخص ، تحت نفس الترخيص. يجب الحفاظ على حقوق النشر وإشعارات الترخيص. يقدم المساهمون منحة صريحة لحقوق البراءة. عند استخدام إصدار معدل لتوفير خدمة عبر شبكة ، يجب توفير شفرة المصدر الكاملة للإصدار المعدل. +\nرخصة جنو العمومية v3.0 +\n +\nإن أذونات هذا الترخيص الأقوى للحقوق المتروكة مشروطة بإتاحة الشفرة المصدرية الكاملة للأعمال والتعديلات المرخصة ، والتي تشتمل على أعمال أكبر باستخدام عمل مرخص ، تحت نفس الترخيص. يجب الحفاظ على حقوق النشر وإشعارات الترخيص. يقدم المساهمون منحة صريحة لحقوق البراءة. عند استخدام إصدار معدل لتوفير خدمة عبر شبكة ، يجب توفير شفرة المصدر الكاملة للإصدار المعدل. الإصدار مشاركة PeerTube بحث From 7317dbf1ebddc0df8ae76db6a35f6e243cb1a955 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Allan=20Nordh=C3=B8y?= Date: Wed, 17 Jun 2020 10:20:43 +0000 Subject: [PATCH 04/50] Translated using Weblate (French) Currently translated at 100.0% (323 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/fr/ --- app/src/main/res/values-fr/strings.xml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/src/main/res/values-fr/strings.xml b/app/src/main/res/values-fr/strings.xml index 73a74d6..e3deee0 100644 --- a/app/src/main/res/values-fr/strings.xml +++ b/app/src/main/res/values-fr/strings.xml @@ -39,7 +39,10 @@ Lecteur vidéo torrent Lecture de vidéo via un flux torrent. Ceci requiert les permissions de stockage. (Alpha, instable !) Licence - Strings related to login + +\nGNU Affero General Public License v3.0 +\n +\nLes autorisations de cette licence de copyleft la plus forte sont conditionnées à la mise à disposition d\'un code source complet des œuvres sous licence et des modifications, qui comprennent des œuvres plus grandes utilisant une œuvre sous licence, sous la même licence. Les avis de droit d\'auteur et de licence doivent être conservés. Les contributeurs accordent expressément des droits de brevet. Lorsqu\'une version modifiée est utilisée pour fournir un service sur un réseau, le code source complet de la version modifiée doit être mis à disposition. Version Rechercher sur PeerTube Rechercher From 3e8089da19e53ae56a583a27ca3e0b8431d7c2e3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Allan=20Nordh=C3=B8y?= Date: Wed, 17 Jun 2020 10:21:53 +0000 Subject: [PATCH 05/50] Translated using Weblate (Chinese (Traditional)) Currently translated at 100.0% (323 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/zh_Hant/ --- app/src/main/res/values-zh-rTW/strings.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/main/res/values-zh-rTW/strings.xml b/app/src/main/res/values-zh-rTW/strings.xml index df9a5a2..e5a6b92 100644 --- a/app/src/main/res/values-zh-rTW/strings.xml +++ b/app/src/main/res/values-zh-rTW/strings.xml @@ -37,7 +37,7 @@ 授權條款 \nAffero通用公眾授權條款 v3.0 -\n +\n \n這份最強的著作傳式授權條款提供作品完整的原始碼與修改,其中包含了使用同一個授權條款的作品。著作權與授權條款聲明都必須保留。貢獻者提供明確的專利權授予。當修改版被用於提供透過網路的服務時,修改版的完整原始碼也必須釋出。 版本 搜尋 PeerTube From 82e224901821505201966eaf9656a6f2b6f622df Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Allan=20Nordh=C3=B8y?= Date: Wed, 17 Jun 2020 10:21:41 +0000 Subject: [PATCH 06/50] Translated using Weblate (Dutch) Currently translated at 100.0% (323 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/nl/ --- app/src/main/res/values-nl/strings.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/src/main/res/values-nl/strings.xml b/app/src/main/res/values-nl/strings.xml index 9e7027d..fb0b405 100644 --- a/app/src/main/res/values-nl/strings.xml +++ b/app/src/main/res/values-nl/strings.xml @@ -288,8 +288,8 @@ Lid geworden op: Er is iets misgegaan; probeer het later opnieuw! -\nGNU Affero General Public License v3.0 -\n +\nGNU Affero General Public License v3.0 +\n \nPermissions of this strongest copyleft license are conditioned on making available complete source code of licensed works and modifications, which include larger works using a licensed work, under the same license. Copyright and license notices must be preserved. Contributors provide an express grant of patent rights. When a modified version is used to provide a service over a network, the complete source code of the modified version must be made available. Server kiezen Registreren toegestaan: %s From 43c4a154830da20f54a4fa425154cdcb61dcc7d6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Allan=20Nordh=C3=B8y?= Date: Wed, 17 Jun 2020 10:21:19 +0000 Subject: [PATCH 07/50] Translated using Weblate (Italian) Currently translated at 100.0% (323 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/it/ --- app/src/main/res/values-it/strings.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/main/res/values-it/strings.xml b/app/src/main/res/values-it/strings.xml index 13eb06f..a473cb6 100644 --- a/app/src/main/res/values-it/strings.xml +++ b/app/src/main/res/values-it/strings.xml @@ -49,7 +49,7 @@ Modo scuro \nGNU Affero General Public License v3.0 -\n +\n \nLe autorizzazioni di questa licenza copyleft più forte sono condizionate a rendere disponibile il codice sorgente completo delle opere concesse in licenza e delle modifiche, che includono opere più grandi utilizzando un lavoro concesso in licenza, sotto la stessa licenza. Le note di copyright e di licenza devono essere conservate. I contributori forniscono una concessione espressa dei diritti di brevetto. Quando si utilizza una versione modificata per fornire un servizio in rete, è necessario rendere disponibile il codice sorgente completo della versione modificata. abcaso afar From 8e128d1f4e023c21860a2f64de8182c9602f42ae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Allan=20Nordh=C3=B8y?= Date: Wed, 17 Jun 2020 10:21:13 +0000 Subject: [PATCH 08/50] Translated using Weblate (Polish) Currently translated at 100.0% (323 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/pl/ --- app/src/main/res/values-pl/strings.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/main/res/values-pl/strings.xml b/app/src/main/res/values-pl/strings.xml index 7519f23..d1b400c 100644 --- a/app/src/main/res/values-pl/strings.xml +++ b/app/src/main/res/values-pl/strings.xml @@ -291,7 +291,7 @@ Pokaż zawartość NSFW Zawartość NSFW -\n Powszechna Licencja Publiczna GNU Affero v3.0 +\n Powszechna Licencja Publiczna GNU Affero v3.0 \n \nUprawnienia tej najsilniejszej licencji copyleft są uzależnione od udostępnienia pełnego kodu źródłowego licencjonowanych utworów i modyfikacji, które obejmują większe dzieła przy użyciu licencjonowanego dzieła, na tej samej licencji. Informacje o prawach autorskich i licencjach należy zachować. Autorzy zapewniają wyraźne przyznanie praw patentowych. Gdy zmodyfikowana wersja jest używana do świadczenia usługi przez sieć, należy udostępnić pełny kod źródłowy zmodyfikowanej wersji. Odtwarzanie wideo przez strumień torrentów. Wymaga to uprawnień do przechowywania. (Alfa, niestabilny!) From 1c5b3d881c29fe0ea734d5bb823358a91f6eded8 Mon Sep 17 00:00:00 2001 From: Don Kimberlin Date: Thu, 18 Jun 2020 23:29:37 -0700 Subject: [PATCH 09/50] Adding configuration setting and supporting code to pause playback on back button. (#167) --- .../peertube/activity/VideoPlayActivity.java | 12 ++++++++++++ .../peertube/fragment/VideoPlayerFragment.java | 4 ++++ app/src/main/res/values/strings.xml | 3 +++ app/src/main/res/xml/pref_general.xml | 6 ++++++ 4 files changed, 25 insertions(+) diff --git a/app/src/main/java/net/schueller/peertube/activity/VideoPlayActivity.java b/app/src/main/java/net/schueller/peertube/activity/VideoPlayActivity.java index 2b69783..3c6c3f5 100644 --- a/app/src/main/java/net/schueller/peertube/activity/VideoPlayActivity.java +++ b/app/src/main/java/net/schueller/peertube/activity/VideoPlayActivity.java @@ -199,4 +199,16 @@ public class VideoPlayActivity extends AppCompatActivity { Log.v(TAG, "onStart()..."); } + public void onBackPressed() { + + SharedPreferences sharedPref = PreferenceManager.getDefaultSharedPreferences(this); + if (sharedPref.getBoolean("pref_back_pause", true)) { + VideoPlayerFragment videoPlayerFragment = (VideoPlayerFragment) + getSupportFragmentManager().findFragmentById(R.id.video_player_fragment); + assert videoPlayerFragment != null; + videoPlayerFragment.pauseVideo(); + } + Log.v(TAG, "onBackPressed()..."); + super.onBackPressed(); + } } diff --git a/app/src/main/java/net/schueller/peertube/fragment/VideoPlayerFragment.java b/app/src/main/java/net/schueller/peertube/fragment/VideoPlayerFragment.java index 62e8d24..39e142d 100644 --- a/app/src/main/java/net/schueller/peertube/fragment/VideoPlayerFragment.java +++ b/app/src/main/java/net/schueller/peertube/fragment/VideoPlayerFragment.java @@ -251,6 +251,10 @@ public class VideoPlayerFragment extends Fragment implements VideoRendererEventL torrentStream.stopStream(); } } + + public void pauseVideo() { + mService.player.setPlayWhenReady(false); + } public void stopVideo() { diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 9cefc3c..ef83c3a 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -60,6 +60,9 @@ PeerTube Server Background Playback If enabled, continues to play video in background. + Pause on back button + Pause background play when pressing back during video playback. + Abkhazian Afar diff --git a/app/src/main/res/xml/pref_general.xml b/app/src/main/res/xml/pref_general.xml index 3b1e6a1..a6d4e93 100644 --- a/app/src/main/res/xml/pref_general.xml +++ b/app/src/main/res/xml/pref_general.xml @@ -24,6 +24,12 @@ android:summary="@string/pref_description_language" android:title="@string/pref_language" /> + + Date: Fri, 19 Jun 2020 08:31:42 +0200 Subject: [PATCH 10/50] Master (#170) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Translations (#163) * Translated using Weblate (Italian) Currently translated at 100.0% (323 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/it/ * Translated using Weblate (Chinese (Simplified)) Currently translated at 38.7% (125 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/zh_Hans/ * Translated using Weblate (French) Currently translated at 100.0% (323 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/fr/ * Translated using Weblate (Chinese (Simplified)) Currently translated at 48.0% (155 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/zh_Hans/ * Translated using Weblate (German) Currently translated at 100.0% (323 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/de/ * Translated using Weblate (French) Currently translated at 100.0% (323 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/fr/ * Translated using Weblate (Russian) Currently translated at 99.3% (321 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/ru/ * Translated using Weblate (Russian) Currently translated at 99.3% (321 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/ru/ * Translated using Weblate (Bengali) Currently translated at 99.3% (321 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/bn/ * Translated using Weblate (Spanish) Currently translated at 42.1% (136 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/es/ * Translated using Weblate (Bengali) Currently translated at 100.0% (323 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/bn/ * Translated using Weblate (Bengali) Currently translated at 99.6% (322 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/bn/ * Translated using Weblate (Persian) Currently translated at 40.2% (130 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/fa/ * Translated using Weblate (Bengali) Currently translated at 99.6% (322 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/bn/ * Translated using Weblate (Bengali) Currently translated at 99.6% (322 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/bn/ * Translated using Weblate (Bengali) Currently translated at 99.6% (322 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/bn/ * Translated using Weblate (Bengali) Currently translated at 100.0% (323 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/bn/ * Translated using Weblate (Polish) Currently translated at 100.0% (323 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/pl/ * Translated using Weblate (Polish) Currently translated at 100.0% (323 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/pl/ * Translated using Weblate (Russian) Currently translated at 100.0% (323 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/ru/ * update library and more (#160) * download files with friendly name (not video ID) * Update Picasso library FIX : add extension in downloaded filename. download files with friendly name (not video ID) * Update Gradle Add 0.75x and 1.25x to play speed * Release v1.0.35 Co-authored-by: Michael Moroni Co-authored-by: mostkai Co-authored-by: B0pol Co-authored-by: Jeannette L Co-authored-by: Nathan Co-authored-by: Mihail Iosilevitch Co-authored-by: anonymous Co-authored-by: Oymate Co-authored-by: Juanro49 Co-authored-by: Mostafa Ahangarha Co-authored-by: Szylu Co-authored-by: Artem Co-authored-by: jmgfr <13685004+jmgfr@users.noreply.github.com> Co-authored-by: Stefan Schueller * Release 1.0.36 (#166) * Translated using Weblate (Italian) Currently translated at 100.0% (323 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/it/ * Translated using Weblate (Chinese (Simplified)) Currently translated at 38.7% (125 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/zh_Hans/ * Translated using Weblate (French) Currently translated at 100.0% (323 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/fr/ * Translated using Weblate (Chinese (Simplified)) Currently translated at 48.0% (155 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/zh_Hans/ * Translated using Weblate (German) Currently translated at 100.0% (323 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/de/ * Translated using Weblate (French) Currently translated at 100.0% (323 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/fr/ * Translated using Weblate (Russian) Currently translated at 99.3% (321 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/ru/ * Translated using Weblate (Russian) Currently translated at 99.3% (321 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/ru/ * Translated using Weblate (Bengali) Currently translated at 99.3% (321 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/bn/ * Translated using Weblate (Spanish) Currently translated at 42.1% (136 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/es/ * Translated using Weblate (Bengali) Currently translated at 100.0% (323 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/bn/ * Translated using Weblate (Bengali) Currently translated at 99.6% (322 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/bn/ * Translated using Weblate (Persian) Currently translated at 40.2% (130 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/fa/ * Translated using Weblate (Bengali) Currently translated at 99.6% (322 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/bn/ * Translated using Weblate (Bengali) Currently translated at 99.6% (322 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/bn/ * Translated using Weblate (Bengali) Currently translated at 99.6% (322 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/bn/ * Translated using Weblate (Bengali) Currently translated at 100.0% (323 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/bn/ * Translated using Weblate (Polish) Currently translated at 100.0% (323 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/pl/ * Translated using Weblate (Polish) Currently translated at 100.0% (323 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/pl/ * Translated using Weblate (Russian) Currently translated at 100.0% (323 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/ru/ * update library and more (#160) * download files with friendly name (not video ID) * Update Picasso library FIX : add extension in downloaded filename. download files with friendly name (not video ID) * Update Gradle Add 0.75x and 1.25x to play speed * Release v1.0.35 * try to fix 'cannot make a new request because the previous response ... ' error (#164) * Translations (#163) * Translated using Weblate (Italian) Currently translated at 100.0% (323 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/it/ * Translated using Weblate (Chinese (Simplified)) Currently translated at 38.7% (125 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/zh_Hans/ * Translated using Weblate (French) Currently translated at 100.0% (323 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/fr/ * Translated using Weblate (Chinese (Simplified)) Currently translated at 48.0% (155 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/zh_Hans/ * Translated using Weblate (German) Currently translated at 100.0% (323 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/de/ * Translated using Weblate (French) Currently translated at 100.0% (323 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/fr/ * Translated using Weblate (Russian) Currently translated at 99.3% (321 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/ru/ * Translated using Weblate (Russian) Currently translated at 99.3% (321 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/ru/ * Translated using Weblate (Bengali) Currently translated at 99.3% (321 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/bn/ * Translated using Weblate (Spanish) Currently translated at 42.1% (136 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/es/ * Translated using Weblate (Bengali) Currently translated at 100.0% (323 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/bn/ * Translated using Weblate (Bengali) Currently translated at 99.6% (322 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/bn/ * Translated using Weblate (Persian) Currently translated at 40.2% (130 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/fa/ * Translated using Weblate (Bengali) Currently translated at 99.6% (322 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/bn/ * Translated using Weblate (Bengali) Currently translated at 99.6% (322 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/bn/ * Translated using Weblate (Bengali) Currently translated at 99.6% (322 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/bn/ * Translated using Weblate (Bengali) Currently translated at 100.0% (323 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/bn/ * Translated using Weblate (Polish) Currently translated at 100.0% (323 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/pl/ * Translated using Weblate (Polish) Currently translated at 100.0% (323 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/pl/ * Translated using Weblate (Russian) Currently translated at 100.0% (323 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/ru/ * update library and more (#160) * download files with friendly name (not video ID) * Update Picasso library FIX : add extension in downloaded filename. download files with friendly name (not video ID) * Update Gradle Add 0.75x and 1.25x to play speed * Release v1.0.35 Co-authored-by: Michael Moroni Co-authored-by: mostkai Co-authored-by: B0pol Co-authored-by: Jeannette L Co-authored-by: Nathan Co-authored-by: Mihail Iosilevitch Co-authored-by: anonymous Co-authored-by: Oymate Co-authored-by: Juanro49 Co-authored-by: Mostafa Ahangarha Co-authored-by: Szylu Co-authored-by: Artem Co-authored-by: jmgfr <13685004+jmgfr@users.noreply.github.com> Co-authored-by: Stefan Schueller * try to fix 'cannot make a new request because the previous response is still open' when login. Co-authored-by: Stefan Schüller Co-authored-by: Michael Moroni Co-authored-by: mostkai Co-authored-by: B0pol Co-authored-by: Jeannette L Co-authored-by: Nathan Co-authored-by: Mihail Iosilevitch Co-authored-by: anonymous Co-authored-by: Oymate Co-authored-by: Juanro49 Co-authored-by: Mostafa Ahangarha Co-authored-by: Szylu Co-authored-by: Artem Co-authored-by: jmgfr <13685004+jmgfr@users.noreply.github.com> Co-authored-by: Stefan Schueller * Release 1.0.36 Co-authored-by: Michael Moroni Co-authored-by: mostkai Co-authored-by: B0pol Co-authored-by: Jeannette L Co-authored-by: Nathan Co-authored-by: Mihail Iosilevitch Co-authored-by: anonymous Co-authored-by: Oymate Co-authored-by: Juanro49 Co-authored-by: Mostafa Ahangarha Co-authored-by: Szylu Co-authored-by: Artem Co-authored-by: jmgfr <13685004+jmgfr@users.noreply.github.com> Co-authored-by: Stefan Schueller Co-authored-by: lishoujun * Adding configuration setting and supporting code to pause playback on back button. (#167) Co-authored-by: Michael Moroni Co-authored-by: mostkai Co-authored-by: B0pol Co-authored-by: Jeannette L Co-authored-by: Nathan Co-authored-by: Mihail Iosilevitch Co-authored-by: anonymous Co-authored-by: Oymate Co-authored-by: Juanro49 Co-authored-by: Mostafa Ahangarha Co-authored-by: Szylu Co-authored-by: Artem Co-authored-by: jmgfr <13685004+jmgfr@users.noreply.github.com> Co-authored-by: Stefan Schueller Co-authored-by: lishoujun Co-authored-by: Don Kimberlin --- .../peertube/activity/VideoPlayActivity.java | 12 ++++++++++++ .../peertube/fragment/VideoPlayerFragment.java | 4 ++++ app/src/main/res/values/strings.xml | 3 +++ app/src/main/res/xml/pref_general.xml | 6 ++++++ 4 files changed, 25 insertions(+) diff --git a/app/src/main/java/net/schueller/peertube/activity/VideoPlayActivity.java b/app/src/main/java/net/schueller/peertube/activity/VideoPlayActivity.java index 2b69783..3c6c3f5 100644 --- a/app/src/main/java/net/schueller/peertube/activity/VideoPlayActivity.java +++ b/app/src/main/java/net/schueller/peertube/activity/VideoPlayActivity.java @@ -199,4 +199,16 @@ public class VideoPlayActivity extends AppCompatActivity { Log.v(TAG, "onStart()..."); } + public void onBackPressed() { + + SharedPreferences sharedPref = PreferenceManager.getDefaultSharedPreferences(this); + if (sharedPref.getBoolean("pref_back_pause", true)) { + VideoPlayerFragment videoPlayerFragment = (VideoPlayerFragment) + getSupportFragmentManager().findFragmentById(R.id.video_player_fragment); + assert videoPlayerFragment != null; + videoPlayerFragment.pauseVideo(); + } + Log.v(TAG, "onBackPressed()..."); + super.onBackPressed(); + } } diff --git a/app/src/main/java/net/schueller/peertube/fragment/VideoPlayerFragment.java b/app/src/main/java/net/schueller/peertube/fragment/VideoPlayerFragment.java index 62e8d24..39e142d 100644 --- a/app/src/main/java/net/schueller/peertube/fragment/VideoPlayerFragment.java +++ b/app/src/main/java/net/schueller/peertube/fragment/VideoPlayerFragment.java @@ -251,6 +251,10 @@ public class VideoPlayerFragment extends Fragment implements VideoRendererEventL torrentStream.stopStream(); } } + + public void pauseVideo() { + mService.player.setPlayWhenReady(false); + } public void stopVideo() { diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 9cefc3c..ef83c3a 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -60,6 +60,9 @@ PeerTube Server Background Playback If enabled, continues to play video in background. + Pause on back button + Pause background play when pressing back during video playback. + Abkhazian Afar diff --git a/app/src/main/res/xml/pref_general.xml b/app/src/main/res/xml/pref_general.xml index 3b1e6a1..a6d4e93 100644 --- a/app/src/main/res/xml/pref_general.xml +++ b/app/src/main/res/xml/pref_general.xml @@ -24,6 +24,12 @@ android:summary="@string/pref_description_language" android:title="@string/pref_language" /> + + Date: Thu, 18 Jun 2020 23:32:26 -0700 Subject: [PATCH 11/50] Making Selecting a search suggestion fill search field (#169) --- .../peertube/activity/VideoListActivity.java | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/app/src/main/java/net/schueller/peertube/activity/VideoListActivity.java b/app/src/main/java/net/schueller/peertube/activity/VideoListActivity.java index 8a68ce6..54abbc7 100644 --- a/app/src/main/java/net/schueller/peertube/activity/VideoListActivity.java +++ b/app/src/main/java/net/schueller/peertube/activity/VideoListActivity.java @@ -24,6 +24,7 @@ import android.content.Context; import android.content.Intent; import android.content.SharedPreferences; import android.content.pm.PackageManager; +import android.database.Cursor; import android.preference.PreferenceManager; import android.provider.SearchRecentSuggestions; @@ -166,7 +167,27 @@ public class VideoListActivity extends CommonActivity { Log.d(TAG, "onDismiss: "); loadVideos(0, count, sort, filter); }); + searchView.setOnSuggestionListener(new SearchView.OnSuggestionListener() { + @Override + public boolean onSuggestionClick(int position) { + String suggestion = getSuggestion(position); + searchView.setQuery(suggestion, true); + return true; + } + private String getSuggestion(int position) { + Cursor cursor = (Cursor) searchView.getSuggestionsAdapter().getItem( + position); + return cursor.getString(cursor + .getColumnIndex(SearchManager.SUGGEST_COLUMN_TEXT_1)); + } + + @Override + public boolean onSuggestionSelect(int position) { + /* Required to implement */ + return true; + } + }); return true; } From 6ad310c398f201c201723436a21ea616993881ad Mon Sep 17 00:00:00 2001 From: Don Kimberlin Date: Thu, 18 Jun 2020 23:33:43 -0700 Subject: [PATCH 12/50] Adding configuration setting and supporting code to choose language (#168) --- .../peertube/activity/CommonActivity.java | 18 +++++++ app/src/main/res/values/array.xml | 52 +++++++++++++++++++ app/src/main/res/values/strings.xml | 3 +- app/src/main/res/xml/pref_general.xml | 9 ++++ 4 files changed, 81 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/net/schueller/peertube/activity/CommonActivity.java b/app/src/main/java/net/schueller/peertube/activity/CommonActivity.java index 60c3589..a733fca 100644 --- a/app/src/main/java/net/schueller/peertube/activity/CommonActivity.java +++ b/app/src/main/java/net/schueller/peertube/activity/CommonActivity.java @@ -19,12 +19,15 @@ package net.schueller.peertube.activity; import android.content.SharedPreferences; +import android.content.res.Configuration; import android.os.Bundle; import android.preference.PreferenceManager; import androidx.appcompat.app.AppCompatActivity; import androidx.appcompat.app.AppCompatDelegate; +import java.util.Locale; + import static net.schueller.peertube.helper.Constants.DEFAULT_THEME; import static net.schueller.peertube.helper.Constants.THEME_PREF_KEY; @@ -45,6 +48,21 @@ public class CommonActivity extends AppCompatActivity { "style", getPackageName()) ); + + // Set language + String countryCode=sharedPref.getString("pref_language_app","en"); + Locale locale=new Locale(countryCode);; + //Neither Chinese language choice was working, found this fix on stack overflow + if(countryCode.equals("zh-rCN")) + locale = Locale.SIMPLIFIED_CHINESE; + if(countryCode.equals("zh-rTW")) + locale = Locale.TRADITIONAL_CHINESE; + + Locale.setDefault(locale); + Configuration config = getBaseContext().getResources().getConfiguration(); + config.locale = locale; + getBaseContext().getResources().updateConfiguration(config, + getBaseContext().getResources().getDisplayMetrics()); } } diff --git a/app/src/main/res/values/array.xml b/app/src/main/res/values/array.xml index 5936a02..8a7d9f6 100644 --- a/app/src/main/res/values/array.xml +++ b/app/src/main/res/values/array.xml @@ -433,6 +433,58 @@ za zu + + + ar + bn + cs + de + el + en + es + fa + fi + fr + gd + hi + it + ja + no + nl + pl + ru + sv + tr + zh-rCN + zh-rTW + + + + @string/ar + @string/bn + @string/cs + @string/de + @string/el + @string/en + @string/es + @string/fa + @string/fi + @string/fr + @string/gd + @string/hi + @string/it + @string/ja + @string/no + @string/nl + @string/pl + @string/ru + @string/sv + @string/tr + @string/zh + @string/tw + + + diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index ef83c3a..b64e99e 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -60,9 +60,10 @@ PeerTube Server Background Playback If enabled, continues to play video in background. + Application Language + Select language for application interface. Restart app for change to take effect. Pause on back button Pause background play when pressing back during video playback. - Abkhazian Afar diff --git a/app/src/main/res/xml/pref_general.xml b/app/src/main/res/xml/pref_general.xml index a6d4e93..e7c3dd8 100644 --- a/app/src/main/res/xml/pref_general.xml +++ b/app/src/main/res/xml/pref_general.xml @@ -30,6 +30,15 @@ android:summary="@string/pref_description_back_pause" android:title="@string/pref_title_back_pause" /> + + /> + Date: Fri, 19 Jun 2020 08:40:23 +0200 Subject: [PATCH 13/50] Version Bump --- CHANGELOG.md | 6 ++++++ app/build.gradle | 4 ++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 638ec4d..890a691 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,9 @@ +### Version 1.0.37 Tag: v1.0.37 (2020-06-19) + * Making Selecting a search suggestion fill search field (@dhk2) + * Adding configuration setting and supporting code to choose language (@dhk2) + * Adding configuration setting and code for configurable back button behavior (@dhk2) + * Various translations + ### Version 1.0.36 Tag: v1.0.36 (2020-06-14) * fix 'cannot make a new request because the previous response (@lishoujun) * Various translations diff --git a/app/build.gradle b/app/build.gradle index 3844e9c..fdc4ca7 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -6,8 +6,8 @@ android { applicationId "net.schueller.peertube" minSdkVersion 21 targetSdkVersion 28 - versionCode 1036 - versionName "1.0.36" + versionCode 1037 + versionName "1.0.37" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" ext { libVersions = [ From 31aa6c9ff7d1bf0d4625741181d3ecee8e69e72a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20Schu=CC=88ller?= Date: Fri, 19 Jun 2020 19:24:21 +0200 Subject: [PATCH 14/50] Fixed merge issue --- app/src/main/res/xml/pref_general.xml | 6 ------ 1 file changed, 6 deletions(-) diff --git a/app/src/main/res/xml/pref_general.xml b/app/src/main/res/xml/pref_general.xml index b455df9..e7c3dd8 100644 --- a/app/src/main/res/xml/pref_general.xml +++ b/app/src/main/res/xml/pref_general.xml @@ -30,12 +30,6 @@ android:summary="@string/pref_description_back_pause" android:title="@string/pref_title_back_pause" /> - - Date: Fri, 19 Jun 2020 21:41:11 +0200 Subject: [PATCH 15/50] Release v1.0.37 (#171) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Translated using Weblate (Italian) Currently translated at 100.0% (323 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/it/ * Translated using Weblate (Chinese (Simplified)) Currently translated at 38.7% (125 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/zh_Hans/ * Translated using Weblate (French) Currently translated at 100.0% (323 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/fr/ * Translated using Weblate (Chinese (Simplified)) Currently translated at 48.0% (155 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/zh_Hans/ * Translated using Weblate (German) Currently translated at 100.0% (323 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/de/ * Translated using Weblate (French) Currently translated at 100.0% (323 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/fr/ * Translated using Weblate (Russian) Currently translated at 99.3% (321 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/ru/ * Translated using Weblate (Russian) Currently translated at 99.3% (321 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/ru/ * Translated using Weblate (Bengali) Currently translated at 99.3% (321 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/bn/ * Translated using Weblate (Spanish) Currently translated at 42.1% (136 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/es/ * Translated using Weblate (Bengali) Currently translated at 100.0% (323 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/bn/ * Translated using Weblate (Bengali) Currently translated at 99.6% (322 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/bn/ * Translated using Weblate (Persian) Currently translated at 40.2% (130 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/fa/ * Translated using Weblate (Bengali) Currently translated at 99.6% (322 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/bn/ * Translated using Weblate (Bengali) Currently translated at 99.6% (322 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/bn/ * Translated using Weblate (Bengali) Currently translated at 99.6% (322 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/bn/ * Translated using Weblate (Bengali) Currently translated at 100.0% (323 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/bn/ * Translated using Weblate (Polish) Currently translated at 100.0% (323 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/pl/ * Translated using Weblate (Polish) Currently translated at 100.0% (323 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/pl/ * Translated using Weblate (Russian) Currently translated at 100.0% (323 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/ru/ * update library and more (#160) * download files with friendly name (not video ID) * Update Picasso library FIX : add extension in downloaded filename. download files with friendly name (not video ID) * Update Gradle Add 0.75x and 1.25x to play speed * Release v1.0.35 * try to fix 'cannot make a new request because the previous response ... ' error (#164) * Translations (#163) * Translated using Weblate (Italian) Currently translated at 100.0% (323 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/it/ * Translated using Weblate (Chinese (Simplified)) Currently translated at 38.7% (125 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/zh_Hans/ * Translated using Weblate (French) Currently translated at 100.0% (323 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/fr/ * Translated using Weblate (Chinese (Simplified)) Currently translated at 48.0% (155 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/zh_Hans/ * Translated using Weblate (German) Currently translated at 100.0% (323 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/de/ * Translated using Weblate (French) Currently translated at 100.0% (323 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/fr/ * Translated using Weblate (Russian) Currently translated at 99.3% (321 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/ru/ * Translated using Weblate (Russian) Currently translated at 99.3% (321 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/ru/ * Translated using Weblate (Bengali) Currently translated at 99.3% (321 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/bn/ * Translated using Weblate (Spanish) Currently translated at 42.1% (136 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/es/ * Translated using Weblate (Bengali) Currently translated at 100.0% (323 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/bn/ * Translated using Weblate (Bengali) Currently translated at 99.6% (322 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/bn/ * Translated using Weblate (Persian) Currently translated at 40.2% (130 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/fa/ * Translated using Weblate (Bengali) Currently translated at 99.6% (322 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/bn/ * Translated using Weblate (Bengali) Currently translated at 99.6% (322 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/bn/ * Translated using Weblate (Bengali) Currently translated at 99.6% (322 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/bn/ * Translated using Weblate (Bengali) Currently translated at 100.0% (323 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/bn/ * Translated using Weblate (Polish) Currently translated at 100.0% (323 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/pl/ * Translated using Weblate (Polish) Currently translated at 100.0% (323 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/pl/ * Translated using Weblate (Russian) Currently translated at 100.0% (323 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/ru/ * update library and more (#160) * download files with friendly name (not video ID) * Update Picasso library FIX : add extension in downloaded filename. download files with friendly name (not video ID) * Update Gradle Add 0.75x and 1.25x to play speed * Release v1.0.35 Co-authored-by: Michael Moroni Co-authored-by: mostkai Co-authored-by: B0pol Co-authored-by: Jeannette L Co-authored-by: Nathan Co-authored-by: Mihail Iosilevitch Co-authored-by: anonymous Co-authored-by: Oymate Co-authored-by: Juanro49 Co-authored-by: Mostafa Ahangarha Co-authored-by: Szylu Co-authored-by: Artem Co-authored-by: jmgfr <13685004+jmgfr@users.noreply.github.com> Co-authored-by: Stefan Schueller * try to fix 'cannot make a new request because the previous response is still open' when login. Co-authored-by: Stefan Schüller Co-authored-by: Michael Moroni Co-authored-by: mostkai Co-authored-by: B0pol Co-authored-by: Jeannette L Co-authored-by: Nathan Co-authored-by: Mihail Iosilevitch Co-authored-by: anonymous Co-authored-by: Oymate Co-authored-by: Juanro49 Co-authored-by: Mostafa Ahangarha Co-authored-by: Szylu Co-authored-by: Artem Co-authored-by: jmgfr <13685004+jmgfr@users.noreply.github.com> Co-authored-by: Stefan Schueller * Release 1.0.36 * Master (#170) * Translations (#163) * Translated using Weblate (Italian) Currently translated at 100.0% (323 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/it/ * Translated using Weblate (Chinese (Simplified)) Currently translated at 38.7% (125 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/zh_Hans/ * Translated using Weblate (French) Currently translated at 100.0% (323 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/fr/ * Translated using Weblate (Chinese (Simplified)) Currently translated at 48.0% (155 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/zh_Hans/ * Translated using Weblate (German) Currently translated at 100.0% (323 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/de/ * Translated using Weblate (French) Currently translated at 100.0% (323 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/fr/ * Translated using Weblate (Russian) Currently translated at 99.3% (321 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/ru/ * Translated using Weblate (Russian) Currently translated at 99.3% (321 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/ru/ * Translated using Weblate (Bengali) Currently translated at 99.3% (321 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/bn/ * Translated using Weblate (Spanish) Currently translated at 42.1% (136 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/es/ * Translated using Weblate (Bengali) Currently translated at 100.0% (323 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/bn/ * Translated using Weblate (Bengali) Currently translated at 99.6% (322 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/bn/ * Translated using Weblate (Persian) Currently translated at 40.2% (130 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/fa/ * Translated using Weblate (Bengali) Currently translated at 99.6% (322 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/bn/ * Translated using Weblate (Bengali) Currently translated at 99.6% (322 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/bn/ * Translated using Weblate (Bengali) Currently translated at 99.6% (322 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/bn/ * Translated using Weblate (Bengali) Currently translated at 100.0% (323 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/bn/ * Translated using Weblate (Polish) Currently translated at 100.0% (323 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/pl/ * Translated using Weblate (Polish) Currently translated at 100.0% (323 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/pl/ * Translated using Weblate (Russian) Currently translated at 100.0% (323 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/ru/ * update library and more (#160) * download files with friendly name (not video ID) * Update Picasso library FIX : add extension in downloaded filename. download files with friendly name (not video ID) * Update Gradle Add 0.75x and 1.25x to play speed * Release v1.0.35 Co-authored-by: Michael Moroni Co-authored-by: mostkai Co-authored-by: B0pol Co-authored-by: Jeannette L Co-authored-by: Nathan Co-authored-by: Mihail Iosilevitch Co-authored-by: anonymous Co-authored-by: Oymate Co-authored-by: Juanro49 Co-authored-by: Mostafa Ahangarha Co-authored-by: Szylu Co-authored-by: Artem Co-authored-by: jmgfr <13685004+jmgfr@users.noreply.github.com> Co-authored-by: Stefan Schueller * Release 1.0.36 (#166) * Translated using Weblate (Italian) Currently translated at 100.0% (323 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/it/ * Translated using Weblate (Chinese (Simplified)) Currently translated at 38.7% (125 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/zh_Hans/ * Translated using Weblate (French) Currently translated at 100.0% (323 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/fr/ * Translated using Weblate (Chinese (Simplified)) Currently translated at 48.0% (155 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/zh_Hans/ * Translated using Weblate (German) Currently translated at 100.0% (323 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/de/ * Translated using Weblate (French) Currently translated at 100.0% (323 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/fr/ * Translated using Weblate (Russian) Currently translated at 99.3% (321 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/ru/ * Translated using Weblate (Russian) Currently translated at 99.3% (321 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/ru/ * Translated using Weblate (Bengali) Currently translated at 99.3% (321 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/bn/ * Translated using Weblate (Spanish) Currently translated at 42.1% (136 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/es/ * Translated using Weblate (Bengali) Currently translated at 100.0% (323 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/bn/ * Translated using Weblate (Bengali) Currently translated at 99.6% (322 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/bn/ * Translated using Weblate (Persian) Currently translated at 40.2% (130 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/fa/ * Translated using Weblate (Bengali) Currently translated at 99.6% (322 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/bn/ * Translated using Weblate (Bengali) Currently translated at 99.6% (322 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/bn/ * Translated using Weblate (Bengali) Currently translated at 99.6% (322 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/bn/ * Translated using Weblate (Bengali) Currently translated at 100.0% (323 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/bn/ * Translated using Weblate (Polish) Currently translated at 100.0% (323 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/pl/ * Translated using Weblate (Polish) Currently translated at 100.0% (323 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/pl/ * Translated using Weblate (Russian) Currently translated at 100.0% (323 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/ru/ * update library and more (#160) * download files with friendly name (not video ID) * Update Picasso library FIX : add extension in downloaded filename. download files with friendly name (not video ID) * Update Gradle Add 0.75x and 1.25x to play speed * Release v1.0.35 * try to fix 'cannot make a new request because the previous response ... ' error (#164) * Translations (#163) * Translated using Weblate (Italian) Currently translated at 100.0% (323 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/it/ * Translated using Weblate (Chinese (Simplified)) Currently translated at 38.7% (125 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/zh_Hans/ * Translated using Weblate (French) Currently translated at 100.0% (323 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/fr/ * Translated using Weblate (Chinese (Simplified)) Currently translated at 48.0% (155 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/zh_Hans/ * Translated using Weblate (German) Currently translated at 100.0% (323 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/de/ * Translated using Weblate (French) Currently translated at 100.0% (323 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/fr/ * Translated using Weblate (Russian) Currently translated at 99.3% (321 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/ru/ * Translated using Weblate (Russian) Currently translated at 99.3% (321 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/ru/ * Translated using Weblate (Bengali) Currently translated at 99.3% (321 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/bn/ * Translated using Weblate (Spanish) Currently translated at 42.1% (136 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/es/ * Translated using Weblate (Bengali) Currently translated at 100.0% (323 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/bn/ * Translated using Weblate (Bengali) Currently translated at 99.6% (322 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/bn/ * Translated using Weblate (Persian) Currently translated at 40.2% (130 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/fa/ * Translated using Weblate (Bengali) Currently translated at 99.6% (322 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/bn/ * Translated using Weblate (Bengali) Currently translated at 99.6% (322 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/bn/ * Translated using Weblate (Bengali) Currently translated at 99.6% (322 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/bn/ * Translated using Weblate (Bengali) Currently translated at 100.0% (323 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/bn/ * Translated using Weblate (Polish) Currently translated at 100.0% (323 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/pl/ * Translated using Weblate (Polish) Currently translated at 100.0% (323 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/pl/ * Translated using Weblate (Russian) Currently translated at 100.0% (323 of 323 strings) Translation: PeerTube/Android Translate-URL: https://hosted.weblate.org/projects/peertube/android/ru/ * update library and more (#160) * download files with friendly name (not video ID) * Update Picasso library FIX : add extension in downloaded filename. download files with friendly name (not video ID) * Update Gradle Add 0.75x and 1.25x to play speed * Release v1.0.35 Co-authored-by: Michael Moroni Co-authored-by: mostkai Co-authored-by: B0pol Co-authored-by: Jeannette L Co-authored-by: Nathan Co-authored-by: Mihail Iosilevitch Co-authored-by: anonymous Co-authored-by: Oymate Co-authored-by: Juanro49 Co-authored-by: Mostafa Ahangarha Co-authored-by: Szylu Co-authored-by: Artem Co-authored-by: jmgfr <13685004+jmgfr@users.noreply.github.com> Co-authored-by: Stefan Schueller * try to fix 'cannot make a new request because the previous response is still open' when login. Co-authored-by: Stefan Schüller Co-authored-by: Michael Moroni Co-authored-by: mostkai Co-authored-by: B0pol Co-authored-by: Jeannette L Co-authored-by: Nathan Co-authored-by: Mihail Iosilevitch Co-authored-by: anonymous Co-authored-by: Oymate Co-authored-by: Juanro49 Co-authored-by: Mostafa Ahangarha Co-authored-by: Szylu Co-authored-by: Artem Co-authored-by: jmgfr <13685004+jmgfr@users.noreply.github.com> Co-authored-by: Stefan Schueller * Release 1.0.36 Co-authored-by: Michael Moroni Co-authored-by: mostkai Co-authored-by: B0pol Co-authored-by: Jeannette L Co-authored-by: Nathan Co-authored-by: Mihail Iosilevitch Co-authored-by: anonymous Co-authored-by: Oymate Co-authored-by: Juanro49 Co-authored-by: Mostafa Ahangarha Co-authored-by: Szylu Co-authored-by: Artem Co-authored-by: jmgfr <13685004+jmgfr@users.noreply.github.com> Co-authored-by: Stefan Schueller Co-authored-by: lishoujun * Adding configuration setting and supporting code to pause playback on back button. (#167) Co-authored-by: Michael Moroni Co-authored-by: mostkai Co-authored-by: B0pol Co-authored-by: Jeannette L Co-authored-by: Nathan Co-authored-by: Mihail Iosilevitch Co-authored-by: anonymous Co-authored-by: Oymate Co-authored-by: Juanro49 Co-authored-by: Mostafa Ahangarha Co-authored-by: Szylu Co-authored-by: Artem Co-authored-by: jmgfr <13685004+jmgfr@users.noreply.github.com> Co-authored-by: Stefan Schueller Co-authored-by: lishoujun Co-authored-by: Don Kimberlin * Making Selecting a search suggestion fill search field (#169) * Adding configuration setting and supporting code to choose language (#168) * Version Bump * Fixed merge issue Co-authored-by: Michael Moroni Co-authored-by: mostkai Co-authored-by: B0pol Co-authored-by: Jeannette L Co-authored-by: Nathan Co-authored-by: Mihail Iosilevitch Co-authored-by: anonymous Co-authored-by: Oymate Co-authored-by: Juanro49 Co-authored-by: Mostafa Ahangarha Co-authored-by: Szylu Co-authored-by: Artem Co-authored-by: jmgfr <13685004+jmgfr@users.noreply.github.com> Co-authored-by: Stefan Schueller Co-authored-by: lishoujun Co-authored-by: Don Kimberlin --- CHANGELOG.md | 6 +++ app/build.gradle | 4 +- .../peertube/activity/CommonActivity.java | 18 +++++++ .../peertube/activity/VideoListActivity.java | 21 ++++++++ app/src/main/res/values/array.xml | 52 +++++++++++++++++++ app/src/main/res/values/strings.xml | 2 + app/src/main/res/xml/pref_general.xml | 9 ++++ 7 files changed, 110 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 638ec4d..890a691 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,9 @@ +### Version 1.0.37 Tag: v1.0.37 (2020-06-19) + * Making Selecting a search suggestion fill search field (@dhk2) + * Adding configuration setting and supporting code to choose language (@dhk2) + * Adding configuration setting and code for configurable back button behavior (@dhk2) + * Various translations + ### Version 1.0.36 Tag: v1.0.36 (2020-06-14) * fix 'cannot make a new request because the previous response (@lishoujun) * Various translations diff --git a/app/build.gradle b/app/build.gradle index 3844e9c..fdc4ca7 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -6,8 +6,8 @@ android { applicationId "net.schueller.peertube" minSdkVersion 21 targetSdkVersion 28 - versionCode 1036 - versionName "1.0.36" + versionCode 1037 + versionName "1.0.37" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" ext { libVersions = [ diff --git a/app/src/main/java/net/schueller/peertube/activity/CommonActivity.java b/app/src/main/java/net/schueller/peertube/activity/CommonActivity.java index 60c3589..a733fca 100644 --- a/app/src/main/java/net/schueller/peertube/activity/CommonActivity.java +++ b/app/src/main/java/net/schueller/peertube/activity/CommonActivity.java @@ -19,12 +19,15 @@ package net.schueller.peertube.activity; import android.content.SharedPreferences; +import android.content.res.Configuration; import android.os.Bundle; import android.preference.PreferenceManager; import androidx.appcompat.app.AppCompatActivity; import androidx.appcompat.app.AppCompatDelegate; +import java.util.Locale; + import static net.schueller.peertube.helper.Constants.DEFAULT_THEME; import static net.schueller.peertube.helper.Constants.THEME_PREF_KEY; @@ -45,6 +48,21 @@ public class CommonActivity extends AppCompatActivity { "style", getPackageName()) ); + + // Set language + String countryCode=sharedPref.getString("pref_language_app","en"); + Locale locale=new Locale(countryCode);; + //Neither Chinese language choice was working, found this fix on stack overflow + if(countryCode.equals("zh-rCN")) + locale = Locale.SIMPLIFIED_CHINESE; + if(countryCode.equals("zh-rTW")) + locale = Locale.TRADITIONAL_CHINESE; + + Locale.setDefault(locale); + Configuration config = getBaseContext().getResources().getConfiguration(); + config.locale = locale; + getBaseContext().getResources().updateConfiguration(config, + getBaseContext().getResources().getDisplayMetrics()); } } diff --git a/app/src/main/java/net/schueller/peertube/activity/VideoListActivity.java b/app/src/main/java/net/schueller/peertube/activity/VideoListActivity.java index 8a68ce6..54abbc7 100644 --- a/app/src/main/java/net/schueller/peertube/activity/VideoListActivity.java +++ b/app/src/main/java/net/schueller/peertube/activity/VideoListActivity.java @@ -24,6 +24,7 @@ import android.content.Context; import android.content.Intent; import android.content.SharedPreferences; import android.content.pm.PackageManager; +import android.database.Cursor; import android.preference.PreferenceManager; import android.provider.SearchRecentSuggestions; @@ -166,7 +167,27 @@ public class VideoListActivity extends CommonActivity { Log.d(TAG, "onDismiss: "); loadVideos(0, count, sort, filter); }); + searchView.setOnSuggestionListener(new SearchView.OnSuggestionListener() { + @Override + public boolean onSuggestionClick(int position) { + String suggestion = getSuggestion(position); + searchView.setQuery(suggestion, true); + return true; + } + private String getSuggestion(int position) { + Cursor cursor = (Cursor) searchView.getSuggestionsAdapter().getItem( + position); + return cursor.getString(cursor + .getColumnIndex(SearchManager.SUGGEST_COLUMN_TEXT_1)); + } + + @Override + public boolean onSuggestionSelect(int position) { + /* Required to implement */ + return true; + } + }); return true; } diff --git a/app/src/main/res/values/array.xml b/app/src/main/res/values/array.xml index 5936a02..8a7d9f6 100644 --- a/app/src/main/res/values/array.xml +++ b/app/src/main/res/values/array.xml @@ -433,6 +433,58 @@ za zu + + + ar + bn + cs + de + el + en + es + fa + fi + fr + gd + hi + it + ja + no + nl + pl + ru + sv + tr + zh-rCN + zh-rTW + + + + @string/ar + @string/bn + @string/cs + @string/de + @string/el + @string/en + @string/es + @string/fa + @string/fi + @string/fr + @string/gd + @string/hi + @string/it + @string/ja + @string/no + @string/nl + @string/pl + @string/ru + @string/sv + @string/tr + @string/zh + @string/tw + + + diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index ef83c3a..c9cccd5 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -63,6 +63,8 @@ Pause on back button Pause background play when pressing back during video playback. + Application Language + Select language for application interface. Restart app for change to take effect. Abkhazian Afar diff --git a/app/src/main/res/xml/pref_general.xml b/app/src/main/res/xml/pref_general.xml index a6d4e93..e7c3dd8 100644 --- a/app/src/main/res/xml/pref_general.xml +++ b/app/src/main/res/xml/pref_general.xml @@ -30,6 +30,15 @@ android:summary="@string/pref_description_back_pause" android:title="@string/pref_title_back_pause" /> + + /> + Date: Sat, 20 Jun 2020 06:10:25 -0700 Subject: [PATCH 16/50] Clear search history (#173) * Long press on magnifying glass to clear search history * Long press on magnifying glass to clear search history * Long press on magnifying glass to clear search history * Long press on magnifying glass to clear search history * Long press on magnifying glass to clear search history * Long press on magnifying glass to clear search history --- .../peertube/activity/VideoListActivity.java | 22 +++++++++++++++++++ app/src/main/res/values/strings.xml | 2 ++ 2 files changed, 24 insertions(+) diff --git a/app/src/main/java/net/schueller/peertube/activity/VideoListActivity.java b/app/src/main/java/net/schueller/peertube/activity/VideoListActivity.java index 54abbc7..107a200 100644 --- a/app/src/main/java/net/schueller/peertube/activity/VideoListActivity.java +++ b/app/src/main/java/net/schueller/peertube/activity/VideoListActivity.java @@ -19,8 +19,10 @@ package net.schueller.peertube.activity; import android.Manifest; +import android.app.AlertDialog; import android.app.SearchManager; import android.content.Context; +import android.content.DialogInterface; import android.content.Intent; import android.content.SharedPreferences; import android.content.pm.PackageManager; @@ -146,6 +148,26 @@ public class VideoListActivity extends CommonActivity { searchView.setIconifiedByDefault(false); // Do not iconify the widget; expand it by default searchView.setQueryRefinementEnabled(true); + searchMenuItem.getActionView().setOnLongClickListener(new View.OnLongClickListener() { + @Override + public boolean onLongClick(View v) { + new AlertDialog.Builder(VideoListActivity.this) + .setTitle(getString(R.string.clear_search_history)) + .setMessage(getString(R.string.clear_search_history_prompt)) + .setPositiveButton(android.R.string.yes, new DialogInterface.OnClickListener() { + public void onClick(DialogInterface dialog, int which) { + SearchRecentSuggestions suggestions = new SearchRecentSuggestions(getApplicationContext(), + SearchSuggestionsProvider.AUTHORITY, + SearchSuggestionsProvider.MODE); + suggestions.clearHistory(); + } + }) + .setNegativeButton(android.R.string.no, null) + .setIcon(android.R.drawable.ic_dialog_alert) + .show(); + return true; + } + }); searchMenuItem.setOnActionExpandListener(new MenuItem.OnActionExpandListener() { @Override public boolean onMenuItemActionExpand(MenuItem menuItem) { diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index c9cccd5..fdc857d 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -65,6 +65,8 @@ Application Language Select language for application interface. Restart app for change to take effect. + Clear Search History + Do you want to permanently delete the search history? Abkhazian Afar From e337225cbf19ca33410065e33439e1b599ad6f69 Mon Sep 17 00:00:00 2001 From: Oymate Date: Sun, 21 Jun 2020 12:12:01 +0000 Subject: [PATCH 17/50] Added translation using Weblate (Bengali (Bangladesh)) --- app/src/main/res/values-bn-rBD/strings.xml | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 app/src/main/res/values-bn-rBD/strings.xml diff --git a/app/src/main/res/values-bn-rBD/strings.xml b/app/src/main/res/values-bn-rBD/strings.xml new file mode 100644 index 0000000..a6b3dae --- /dev/null +++ b/app/src/main/res/values-bn-rBD/strings.xml @@ -0,0 +1,2 @@ + + \ No newline at end of file From 5c7fab1a754340090e3e61a869cf2f8b614c8865 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20Sch=C3=BCller?= Date: Sun, 21 Jun 2020 17:01:15 +0200 Subject: [PATCH 18/50] Server login (#175) --- CHANGELOG.md | 5 + app/build.gradle | 32 +++- app/src/main/AndroidManifest.xml | 22 +-- .../peertube/activity/AccountActivity.java | 8 +- .../activity/AppCompatPreferenceActivity.java | 19 ++ .../peertube/activity/MeActivity.java | 112 ++++++----- .../activity/SelectServerActivity.java | 40 ++-- .../activity/ServerAddressBookActivity.java | 168 +++++++++++++++++ .../peertube/activity/SettingsActivity.java | 23 +-- .../peertube/activity/VideoListActivity.java | 59 +++--- .../peertube/adapter/ServerAdapter.java | 22 ++- .../peertube/adapter/ServerListAdapter.java | 158 ++++++++++++++++ .../peertube/application/AppApplication.java | 17 ++ .../peertube/database/AppDatabase.java | 26 +++ .../schueller/peertube/database/Server.java | 87 +++++++++ .../peertube/database/ServerDao.java | 43 +++++ .../peertube/database/ServerRepository.java | 80 ++++++++ .../peertube/database/ServerRoomDatabase.java | 57 ++++++ .../peertube/database/ServerViewModel.java | 45 +++++ .../peertube/fragment/AddServerFragment.java | 178 ++++++++++++++++++ .../LoginService.java} | 120 +++--------- app/src/main/res/anim/slide_in_bottom.xml | 6 + app/src/main/res/anim/slide_out_bottom.xml | 6 + .../ic_baseline_account_circle_24.xml | 10 + .../main/res/drawable/ic_baseline_add_24.xml | 10 + .../res/drawable/ic_baseline_close_24.xml | 10 + .../main/res/drawable/ic_baseline_help_24.xml | 10 + .../drawable/ic_baseline_person_pin_24.xml | 10 + .../res/drawable/ic_baseline_settings_24.xml | 10 + .../drawable/ic_baseline_video_library_24.xml | 10 + app/src/main/res/layout/activity_login.xml | 113 ----------- app/src/main/res/layout/activity_me.xml | 149 ++++++++++++++- .../layout/activity_server_address_book.xml | 21 +++ .../res/layout/activity_server_selection.xml | 40 ---- .../layout/content_server_address_book.xml | 21 +++ .../main/res/layout/fragment_add_server.xml | 73 +++++++ app/src/main/res/layout/row_serverbook.xml | 51 +++++ app/src/main/res/menu/menu_top_account.xml | 5 - app/src/main/res/menu/menu_top_videolist.xml | 6 +- app/src/main/res/values/strings.xml | 36 +++- app/src/main/res/values/styles.xml | 49 +++-- app/src/main/res/xml/pref_general.xml | 3 - gradle/wrapper/gradle-wrapper.properties | 2 +- 43 files changed, 1546 insertions(+), 426 deletions(-) create mode 100644 app/src/main/java/net/schueller/peertube/activity/ServerAddressBookActivity.java create mode 100644 app/src/main/java/net/schueller/peertube/adapter/ServerListAdapter.java create mode 100644 app/src/main/java/net/schueller/peertube/database/AppDatabase.java create mode 100644 app/src/main/java/net/schueller/peertube/database/Server.java create mode 100644 app/src/main/java/net/schueller/peertube/database/ServerDao.java create mode 100644 app/src/main/java/net/schueller/peertube/database/ServerRepository.java create mode 100644 app/src/main/java/net/schueller/peertube/database/ServerRoomDatabase.java create mode 100644 app/src/main/java/net/schueller/peertube/database/ServerViewModel.java create mode 100644 app/src/main/java/net/schueller/peertube/fragment/AddServerFragment.java rename app/src/main/java/net/schueller/peertube/{activity/LoginActivity.java => service/LoginService.java} (50%) create mode 100644 app/src/main/res/anim/slide_in_bottom.xml create mode 100644 app/src/main/res/anim/slide_out_bottom.xml create mode 100644 app/src/main/res/drawable/ic_baseline_account_circle_24.xml create mode 100644 app/src/main/res/drawable/ic_baseline_add_24.xml create mode 100644 app/src/main/res/drawable/ic_baseline_close_24.xml create mode 100644 app/src/main/res/drawable/ic_baseline_help_24.xml create mode 100644 app/src/main/res/drawable/ic_baseline_person_pin_24.xml create mode 100644 app/src/main/res/drawable/ic_baseline_settings_24.xml create mode 100644 app/src/main/res/drawable/ic_baseline_video_library_24.xml delete mode 100644 app/src/main/res/layout/activity_login.xml create mode 100644 app/src/main/res/layout/activity_server_address_book.xml create mode 100644 app/src/main/res/layout/content_server_address_book.xml create mode 100644 app/src/main/res/layout/fragment_add_server.xml create mode 100644 app/src/main/res/layout/row_serverbook.xml diff --git a/CHANGELOG.md b/CHANGELOG.md index 890a691..8f17fcc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -23,6 +23,11 @@ * Gradle update * Translations +### Version 1.0.31 Tag: v1.0.31 (2019-09-25) +* Renamed overview to discover (PeerTube v1.4.0) +* Translations +* Gradle dependencies updates + ### Version 1.0.30 Tag: v1.0.30 (2019-08-07) * Gradle update * Translations diff --git a/app/build.gradle b/app/build.gradle index fdc4ca7..c5ba738 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -1,11 +1,11 @@ apply plugin: 'com.android.application' android { - compileSdkVersion 28 + compileSdkVersion 29 defaultConfig { applicationId "net.schueller.peertube" minSdkVersion 21 - targetSdkVersion 28 + targetSdkVersion 29 versionCode 1037 versionName "1.0.37" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" @@ -14,6 +14,14 @@ android { exoplayer: '2.9.3' ] } + javaCompileOptions { + annotationProcessorOptions { + arguments = [ + "room.schemaLocation" : "$projectDir/schemas".toString(), + "room.incremental" : "true", + "room.expandProjection": "true"] + } + } dependencies { implementation fileTree(dir: 'libs', include: ['*.jar']) @@ -70,7 +78,6 @@ android { sourceCompatibility JavaVersion.VERSION_1_8 targetCompatibility JavaVersion.VERSION_1_8 } - buildToolsVersion '28.0.3' applicationVariants.all { variant -> variant.resValue "string", "versionName", variant.versionName @@ -78,6 +85,23 @@ android { } dependencies { - implementation 'androidx.constraintlayout:constraintlayout:2.0.0-beta6' + def room_version = "2.2.5" + def archLifecycleVersion = '2.1.0' + + implementation 'androidx.constraintlayout:constraintlayout:2.0.0-beta7' implementation 'androidx.appcompat:appcompat:1.1.0' + implementation 'androidx.constraintlayout:constraintlayout:1.1.3' + implementation 'com.google.android.material:material:1.1.0' + + // database lib + implementation "androidx.room:room-runtime:$room_version" + implementation 'androidx.legacy:legacy-support-v4:1.0.0' + implementation 'androidx.lifecycle:lifecycle-extensions:2.2.0' + annotationProcessor "androidx.room:room-compiler:$room_version" + androidTestImplementation "androidx.room:room-testing:$room_version" + + // Lifecycle components + implementation "androidx.lifecycle:lifecycle-extensions:$archLifecycleVersion" + annotationProcessor "androidx.lifecycle:lifecycle-common-java8:$archLifecycleVersion" + } diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 5250d9f..11f705c 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -2,11 +2,7 @@ - - - - - + + + android:resource="@xml/searchable" /> - - + + + + + \ No newline at end of file diff --git a/app/src/main/java/net/schueller/peertube/activity/AccountActivity.java b/app/src/main/java/net/schueller/peertube/activity/AccountActivity.java index 4c4b5cf..d80b58c 100644 --- a/app/src/main/java/net/schueller/peertube/activity/AccountActivity.java +++ b/app/src/main/java/net/schueller/peertube/activity/AccountActivity.java @@ -48,6 +48,7 @@ import net.schueller.peertube.network.RetrofitInstance; import java.util.ArrayList; +import java.util.Objects; import java.util.Set; import androidx.annotation.NonNull; @@ -145,11 +146,10 @@ public class AccountActivity extends CommonActivity { Toolbar toolbar = findViewById(R.id.tool_bar_account); // Setting toolbar as the ActionBar with setSupportActionBar() call setSupportActionBar(toolbar); - getSupportActionBar().setDisplayHomeAsUpEnabled(true); + + Objects.requireNonNull(getSupportActionBar()).setDisplayHomeAsUpEnabled(true); + getSupportActionBar().setHomeAsUpIndicator(R.drawable.ic_baseline_close_24); getSupportActionBar().setTitle(displayNameAndHost); - getSupportActionBar().setHomeAsUpIndicator( - new IconicsDrawable(this, FontAwesome.Icon.faw_chevron_left).actionBar() - ); loadAccountVideos(displayNameAndHost); diff --git a/app/src/main/java/net/schueller/peertube/activity/AppCompatPreferenceActivity.java b/app/src/main/java/net/schueller/peertube/activity/AppCompatPreferenceActivity.java index b2d9461..36d5fe0 100644 --- a/app/src/main/java/net/schueller/peertube/activity/AppCompatPreferenceActivity.java +++ b/app/src/main/java/net/schueller/peertube/activity/AppCompatPreferenceActivity.java @@ -18,6 +18,7 @@ package net.schueller.peertube.activity; +import android.content.SharedPreferences; import android.content.res.Configuration; import android.os.Bundle; import android.preference.PreferenceActivity; @@ -25,10 +26,14 @@ import androidx.annotation.LayoutRes; import androidx.appcompat.app.ActionBar; import androidx.appcompat.app.AppCompatDelegate; +import android.preference.PreferenceManager; import android.view.MenuInflater; import android.view.View; import android.view.ViewGroup; +import static net.schueller.peertube.helper.Constants.DEFAULT_THEME; +import static net.schueller.peertube.helper.Constants.THEME_PREF_KEY; + /** * A {@link android.preference.PreferenceActivity} which implements and proxies the necessary calls * to be used with AppCompat. @@ -42,6 +47,20 @@ public abstract class AppCompatPreferenceActivity extends PreferenceActivity { getDelegate().installViewFactory(); getDelegate().onCreate(savedInstanceState); super.onCreate(savedInstanceState); + + // TODO: cleanup this duplication + + // Set Night Mode + SharedPreferences sharedPref = PreferenceManager.getDefaultSharedPreferences(this); + AppCompatDelegate.setDefaultNightMode(sharedPref.getBoolean("pref_dark_mode", false) ? + AppCompatDelegate.MODE_NIGHT_YES : AppCompatDelegate.MODE_NIGHT_NO); + + // Set theme + setTheme(getResources().getIdentifier( + sharedPref.getString(THEME_PREF_KEY, DEFAULT_THEME), + "style", + getPackageName()) + ); } @Override diff --git a/app/src/main/java/net/schueller/peertube/activity/MeActivity.java b/app/src/main/java/net/schueller/peertube/activity/MeActivity.java index 4153d74..572bb68 100644 --- a/app/src/main/java/net/schueller/peertube/activity/MeActivity.java +++ b/app/src/main/java/net/schueller/peertube/activity/MeActivity.java @@ -19,18 +19,20 @@ package net.schueller.peertube.activity; import android.content.Intent; +import android.net.Uri; +import android.nfc.Tag; import android.os.Bundle; import android.util.Log; import android.view.Menu; import android.view.MenuInflater; -import android.view.MenuItem; +import android.view.View; +import android.widget.ImageView; +import android.widget.LinearLayout; import android.widget.TextView; -import com.mikepenz.fontawesome_typeface_library.FontAwesome; -import com.mikepenz.iconics.IconicsDrawable; - import net.schueller.peertube.R; import net.schueller.peertube.helper.APIUrlHelper; +import net.schueller.peertube.model.Avatar; import net.schueller.peertube.model.Me; import net.schueller.peertube.network.GetUserService; import net.schueller.peertube.network.RetrofitInstance; @@ -38,10 +40,17 @@ import net.schueller.peertube.network.Session; import androidx.annotation.NonNull; import androidx.appcompat.widget.Toolbar; + +import com.squareup.picasso.Picasso; + +import java.util.Objects; + import retrofit2.Call; import retrofit2.Callback; import retrofit2.Response; +import static net.schueller.peertube.application.AppApplication.getContext; + public class MeActivity extends CommonActivity { @@ -52,34 +61,10 @@ public class MeActivity extends CommonActivity { MenuInflater inflater = getMenuInflater(); inflater.inflate(R.menu.menu_top_account, menu); - // Set an icon in the ActionBar - menu.findItem(R.id.action_logout).setIcon( - new IconicsDrawable(this, FontAwesome.Icon.faw_sign_out_alt).actionBar()); - return true; } - @Override - public boolean onOptionsItemSelected(MenuItem item) { - - switch (item.getItemId()) { - // action with ID action_refresh was selected - - case R.id.action_logout: - Session.getInstance().invalidate(); - Intent intent = new Intent(this, LoginActivity.class); - intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP); - this.startActivity(intent); - finish(); - return true; - default: - break; - } - - return super.onOptionsItemSelected(item); - } - @Override public boolean onSupportNavigateUp() { finish(); // close this activity as oppose to navigating up @@ -97,66 +82,99 @@ public class MeActivity extends CommonActivity { Toolbar toolbar = findViewById(R.id.tool_bar_me); // Setting toolbar as the ActionBar with setSupportActionBar() call setSupportActionBar(toolbar); - getSupportActionBar().setDisplayHomeAsUpEnabled(true); - getSupportActionBar().setHomeAsUpIndicator( - new IconicsDrawable(this, FontAwesome.Icon.faw_chevron_left).actionBar() - ); + Objects.requireNonNull(getSupportActionBar()).setDisplayHomeAsUpEnabled(true); + getSupportActionBar().setHomeAsUpIndicator(R.drawable.ic_baseline_close_24); + + LinearLayout account = findViewById(R.id.a_me_account_line); + LinearLayout settings = findViewById(R.id.a_me_settings); + LinearLayout help = findViewById(R.id.a_me_helpnfeedback); + + TextView logout = findViewById(R.id.a_me_logout); - init(); - } + settings.setOnClickListener(view -> { + Intent settingsActivity = new Intent(getContext(), SettingsActivity.class); + //overridePendingTransition(R.anim.slide_in_bottom, 0); + startActivity(settingsActivity); + }); + + help.setOnClickListener(view -> { + String url = "https://github.com/sschueller/peertube-android/issues"; + Intent i = new Intent(Intent.ACTION_VIEW); + i.setData(Uri.parse(url)); + startActivity(i); + }); + + logout.setOnClickListener(view -> { + Session.getInstance().invalidate(); + account.setVisibility(View.GONE); + + }); - private void init() { - // try to get user data getUserData(); } - private boolean getUserData() { - - // TODO + private void getUserData() { String apiBaseURL = APIUrlHelper.getUrlWithVersion(this); + String baseURL = APIUrlHelper.getUrl(this); GetUserService service = RetrofitInstance.getRetrofitInstance(apiBaseURL).create(GetUserService.class); Call call = service.getMe(); call.enqueue(new Callback() { + + LinearLayout account = findViewById(R.id.a_me_account_line); + @Override public void onResponse(@NonNull Call call, @NonNull Response response) { + if (response.isSuccessful()) { Me me = response.body(); - TextView username = findViewById(R.id.account_username); - TextView email = findViewById(R.id.account_email); + Log.d(TAG, response.body().toString()); + + TextView username = findViewById(R.id.a_me_username); + TextView email = findViewById(R.id.a_me_email); + ImageView avatarView = findViewById(R.id.a_me_avatar); + username.setText(me.getUsername()); email.setText(me.getEmail()); - Log.v(TAG, me.getEmail()); + Avatar avatar = me.getAccount().getAvatar(); + if (avatar != null) { + String avatarPath = avatar.getPath(); + Picasso.get() + .load(baseURL + avatarPath) + .into(avatarView); + } + account.setVisibility(View.VISIBLE); + + } else { + account.setVisibility(View.GONE); } - } @Override - public void onFailure(Call call, Throwable t) { - + public void onFailure(@NonNull Call call, @NonNull Throwable t) { + account.setVisibility(View.GONE); } }); - return true; } @Override protected void onResume() { super.onResume(); - init(); + getUserData(); } } diff --git a/app/src/main/java/net/schueller/peertube/activity/SelectServerActivity.java b/app/src/main/java/net/schueller/peertube/activity/SelectServerActivity.java index b2da65f..26d56f2 100644 --- a/app/src/main/java/net/schueller/peertube/activity/SelectServerActivity.java +++ b/app/src/main/java/net/schueller/peertube/activity/SelectServerActivity.java @@ -1,3 +1,20 @@ +/* + * Copyright 2018 Stefan Schüller + * + * License: GPL-3.0+ + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ package net.schueller.peertube.activity; import androidx.annotation.NonNull; @@ -9,6 +26,7 @@ import retrofit2.Call; import retrofit2.Callback; import retrofit2.Response; +import android.content.Intent; import android.content.SharedPreferences; import android.os.Bundle; import android.preference.PreferenceManager; @@ -54,28 +72,6 @@ public class SelectServerActivity extends AppCompatActivity { loadList(); - // set url - TextView selectedUrl = findViewById(R.id.serverSelectedUrl); - selectedUrl.setText(APIUrlHelper.getUrl(SelectServerActivity.this)); - - Button setServerButton = findViewById(R.id.server_selection_set); - setServerButton.setOnClickListener(v -> { - - SharedPreferences sharedPref = PreferenceManager.getDefaultSharedPreferences(this); - SharedPreferences.Editor editor = sharedPref.edit(); - - String serverUrl = APIUrlHelper.cleanServerUrl(selectedUrl.getText().toString()); - - if (!Patterns.WEB_URL.matcher(serverUrl).matches()) { - Toast.makeText(this, R.string.invalid_url, Toast.LENGTH_LONG).show(); - } else { - editor.putString("pref_api_base", serverUrl); - editor.apply(); - this.finish(); - } - - }); - } diff --git a/app/src/main/java/net/schueller/peertube/activity/ServerAddressBookActivity.java b/app/src/main/java/net/schueller/peertube/activity/ServerAddressBookActivity.java new file mode 100644 index 0000000..cedc664 --- /dev/null +++ b/app/src/main/java/net/schueller/peertube/activity/ServerAddressBookActivity.java @@ -0,0 +1,168 @@ +/* + * Copyright 2018 Stefan Schüller + * + * License: GPL-3.0+ + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +package net.schueller.peertube.activity; + +import android.net.Uri; +import android.os.Bundle; +import android.util.Log; +import android.view.View; +import android.widget.EditText; +import android.widget.TextView; +import android.widget.Toast; + +import com.google.android.material.floatingactionbutton.FloatingActionButton; + +import androidx.annotation.NonNull; +import androidx.annotation.Nullable; +import androidx.appcompat.app.AppCompatActivity; +import androidx.appcompat.widget.Toolbar; +import androidx.fragment.app.FragmentManager; +import androidx.fragment.app.FragmentTransaction; +import androidx.lifecycle.Observer; +import androidx.lifecycle.ViewModelProvider; +import androidx.recyclerview.widget.ItemTouchHelper; +import androidx.recyclerview.widget.LinearLayoutManager; +import androidx.recyclerview.widget.RecyclerView; + +import net.schueller.peertube.R; +import net.schueller.peertube.adapter.ServerListAdapter; +import net.schueller.peertube.database.Server; +import net.schueller.peertube.database.ServerViewModel; +import net.schueller.peertube.fragment.AddServerFragment; + +import java.util.List; + + +public class ServerAddressBookActivity extends CommonActivity implements AddServerFragment.OnFragmentInteractionListener { + + private String TAG = "ServerAddressBookActivity"; + public static final String EXTRA_REPLY = "net.schueller.peertube.room.REPLY"; + + private ServerViewModel mServerViewModel; + private AddServerFragment addServerFragment; + private FloatingActionButton floatingActionButton; + private FragmentManager fragmentManager; + + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.activity_server_address_book); + + + mServerViewModel = new ViewModelProvider(this).get(ServerViewModel.class); + + showServers(); + + floatingActionButton = findViewById(R.id.add_server); + floatingActionButton.setOnClickListener(view -> { + + Log.d(TAG, "Click"); + + fragmentManager = getSupportFragmentManager(); + FragmentTransaction fragmentTransaction = fragmentManager.beginTransaction(); + + addServerFragment = new AddServerFragment(); + fragmentTransaction.replace(R.id.server_book, addServerFragment); + fragmentTransaction.commit(); + + floatingActionButton.hide(); + + }); + + } + + @Override + public void onFragmentInteraction(Uri uri) { + + } + + @Override + public void onPointerCaptureChanged(boolean hasCapture) { + + } + + + public void showServers() + { + RecyclerView recyclerView = findViewById(R.id.server_list_recyclerview); + final ServerListAdapter adapter = new ServerListAdapter(this); + recyclerView.setAdapter(adapter); + recyclerView.setLayoutManager(new LinearLayoutManager(this)); + + // Delete items on swipe + ItemTouchHelper helper = new ItemTouchHelper( + new ItemTouchHelper.SimpleCallback(0, + ItemTouchHelper.LEFT | ItemTouchHelper.RIGHT) { + @Override + public boolean onMove(@NonNull RecyclerView recyclerView, + @NonNull RecyclerView.ViewHolder viewHolder, + @NonNull RecyclerView.ViewHolder target) { + return false; + } + + @Override + public void onSwiped(@NonNull RecyclerView.ViewHolder viewHolder, + int direction) { + int position = viewHolder.getAdapterPosition(); + Server server = adapter.getServerAtPosition(position); + Toast.makeText(ServerAddressBookActivity.this, "Deleting " + + server.getServerName(), Toast.LENGTH_LONG).show(); + + // Delete the server + mServerViewModel.delete(server); + } + }); + helper.attachToRecyclerView(recyclerView); + + + // Update the cached copy of the words in the adapter. + mServerViewModel.getAllServers().observe(this, adapter::setServers); + + } + + public void addServer(View view) + { + Log.d(TAG, "addServer"); + + EditText serverLabel = view.findViewById(R.id.serverLabel); + EditText serverUrl = view.findViewById(R.id.serverUrl); + EditText serverUsername = view.findViewById(R.id.serverUsername); + EditText serverPassword = view.findViewById(R.id.serverPassword); + + Server server = new Server(serverLabel.getText().toString()); + + server.setServerHost(serverUrl.getText().toString()); + server.setUsername(serverUsername.getText().toString()); + server.setPassword(serverPassword.getText().toString()); + + mServerViewModel.insert(server); + + FragmentTransaction fragmentTransaction = fragmentManager.beginTransaction(); + fragmentTransaction.remove(addServerFragment); + fragmentTransaction.commit(); + + floatingActionButton.show(); + + } + + public void testServer() + { + + } + +} diff --git a/app/src/main/java/net/schueller/peertube/activity/SettingsActivity.java b/app/src/main/java/net/schueller/peertube/activity/SettingsActivity.java index 2179de4..c8be62b 100644 --- a/app/src/main/java/net/schueller/peertube/activity/SettingsActivity.java +++ b/app/src/main/java/net/schueller/peertube/activity/SettingsActivity.java @@ -135,13 +135,6 @@ public class SettingsActivity extends AppCompatPreferenceActivity { @Override protected void onCreate(Bundle savedInstanceState) { - // Set theme - SharedPreferences sharedPref = PreferenceManager.getDefaultSharedPreferences(this); - setTheme(getResources().getIdentifier( - sharedPref.getString(THEME_PREF_KEY, DEFAULT_THEME), - "style", - getPackageName()) - ); super.onCreate(savedInstanceState); @@ -202,7 +195,7 @@ public class SettingsActivity extends AppCompatPreferenceActivity { // to their values. When their values change, their summaries are // updated to reflect the new value, per the Android Design // guidelines. - bindPreferenceSummaryToValue(findPreference("pref_api_base")); + //bindPreferenceSummaryToValue(findPreference("pref_api_base")); bindPreferenceSummaryToValue(findPreference("pref_theme")); } @@ -219,12 +212,12 @@ public class SettingsActivity extends AppCompatPreferenceActivity { @Override public boolean onPreferenceTreeClick(PreferenceScreen preferenceScreen, Preference preference) { - String key = preference.getKey(); - if ("pref_api_base".equals(key)) { - Intent intentServer = new Intent(preference.getContext(), SelectServerActivity.class); - startActivity(intentServer); - return true; - } +// String key = preference.getKey(); +// if ("pref_api_base".equals(key)) { +// Intent intentServer = new Intent(preference.getContext(), SelectServerActivity.class); +// startActivity(intentServer); +// return true; +// } return false; } @@ -232,7 +225,7 @@ public class SettingsActivity extends AppCompatPreferenceActivity { public void onResume() { setPreferenceScreen(null); addPreferencesFromResource(R.xml.pref_general); - bindPreferenceSummaryToValue(findPreference("pref_api_base")); + //bindPreferenceSummaryToValue(findPreference("pref_api_base")); super.onResume(); } diff --git a/app/src/main/java/net/schueller/peertube/activity/VideoListActivity.java b/app/src/main/java/net/schueller/peertube/activity/VideoListActivity.java index 107a200..c4ca315 100644 --- a/app/src/main/java/net/schueller/peertube/activity/VideoListActivity.java +++ b/app/src/main/java/net/schueller/peertube/activity/VideoListActivity.java @@ -50,6 +50,7 @@ import android.view.Menu; import android.view.MenuInflater; import android.view.MenuItem; import android.view.View; +import android.widget.EditText; import android.widget.TextView; import android.widget.Toast; @@ -81,6 +82,7 @@ public class VideoListActivity extends CommonActivity { public static final String EXTRA_VIDEOID = "VIDEOID"; public static final String EXTRA_ACCOUNTDISPLAYNAME = "ACCOUNTDISPLAYNAMEANDHOST"; + public static final Integer SWITCH_INSTANCE = 2; private VideoAdapter videoAdapter; private SwipeRefreshLayout swipeRefreshLayout; @@ -125,14 +127,11 @@ public class VideoListActivity extends CommonActivity { inflater.inflate(R.menu.menu_top_videolist, menu); // Set an icon in the ActionBar - menu.findItem(R.id.action_settings).setIcon( - new IconicsDrawable(this, FontAwesome.Icon.faw_cog).actionBar()); - menu.findItem(R.id.action_account).setIcon( new IconicsDrawable(this, FontAwesome.Icon.faw_user_circle).actionBar()); -// menu.findItem(R.id.action_server_selection).setIcon( -// new IconicsDrawable(this, FontAwesome.Icon.faw_server).actionBar()); + menu.findItem(R.id.action_server_address_book).setIcon( + new IconicsDrawable(this, FontAwesome.Icon.faw_server).actionBar()); MenuItem searchMenuItem = menu.findItem(R.id.action_search); @@ -219,6 +218,16 @@ public class VideoListActivity extends CommonActivity { stopService(new Intent(this, VideoPlayerService.class)); } + + public void onActivityResult(int requestCode, int resultCode, Intent data) { + super.onActivityResult(requestCode, resultCode, data); + if (requestCode == SWITCH_INSTANCE) { + if(resultCode == RESULT_OK) { + loadVideos(currentStart, count, sort, filter); + } + } + } + @Override public boolean onOptionsItemSelected(MenuItem item) { // Handle action bar item clicks here. The action bar will @@ -231,25 +240,28 @@ public class VideoListActivity extends CommonActivity { //Toast.makeText(this, "Search Selected", Toast.LENGTH_SHORT).show(); return false; - case R.id.action_settings: -// Toast.makeText(this, "Login Selected", Toast.LENGTH_SHORT).show(); - Intent intentSettings = new Intent(this, SettingsActivity.class); - this.startActivity(intentSettings); - - return true; case R.id.action_account: - if (!Session.getInstance().isLoggedIn()) { - Intent intentLogin = new Intent(this, LoginActivity.class); - this.startActivity(intentLogin); - } else { +// if (!Session.getInstance().isLoggedIn()) { + + //Intent intentLogin = new Intent(this, ServerAddressBookActivity.class); + Intent intentMe = new Intent(this, MeActivity.class); this.startActivity(intentMe); - } + + //overridePendingTransition(R.anim.slide_in_bottom, 0); + + + // this.startActivity(intentLogin); + +// } else { +// Intent intentMe = new Intent(this, MeActivity.class); +// this.startActivity(intentMe); +// } + return false; + case R.id.action_server_address_book: + Intent addressBookActivityIntent = new Intent(this, ServerAddressBookActivity.class); + this.startActivityForResult(addressBookActivityIntent, SWITCH_INSTANCE); return false; -// case R.id.action_server_selection: -// Intent intentServer = new Intent(this, SelectServerActivity.class); -// this.startActivity(intentServer); -// return false; default: break; } @@ -378,6 +390,7 @@ public class VideoListActivity extends CommonActivity { @Override protected void onNewIntent(Intent intent) { + super.onNewIntent(intent); setIntent(intent); handleIntent(intent); } @@ -483,8 +496,10 @@ public class VideoListActivity extends CommonActivity { //Log.v(TAG, "navigation_subscriptions"); if (!Session.getInstance().isLoggedIn()) { - Intent intent = new Intent(this, LoginActivity.class); - this.startActivity(intent); +// Intent intent = new Intent(this, LoginActivity.class); +// this.startActivity(intent); + Intent addressBookActivityIntent = new Intent(this, ServerAddressBookActivity.class); + this.startActivityForResult(addressBookActivityIntent, SWITCH_INSTANCE); return false; } else { diff --git a/app/src/main/java/net/schueller/peertube/adapter/ServerAdapter.java b/app/src/main/java/net/schueller/peertube/adapter/ServerAdapter.java index 0e3de08..7bde807 100644 --- a/app/src/main/java/net/schueller/peertube/adapter/ServerAdapter.java +++ b/app/src/main/java/net/schueller/peertube/adapter/ServerAdapter.java @@ -18,6 +18,7 @@ package net.schueller.peertube.adapter; import android.content.Context; +import android.content.Intent; import android.content.SharedPreferences; import android.preference.PreferenceManager; import android.view.LayoutInflater; @@ -37,6 +38,8 @@ import java.util.ArrayList; import androidx.annotation.NonNull; import androidx.recyclerview.widget.RecyclerView; +import static android.app.Activity.RESULT_OK; + public class ServerAdapter extends RecyclerView.Adapter { @@ -75,18 +78,25 @@ public class ServerAdapter extends RecyclerView.Adapter { - SharedPreferences sharedPref = PreferenceManager.getDefaultSharedPreferences(activity); - SharedPreferences.Editor editor = sharedPref.edit(); +// SharedPreferences sharedPref = PreferenceManager.getDefaultSharedPreferences(activity); +// SharedPreferences.Editor editor = sharedPref.edit(); String serverUrl = APIUrlHelper.cleanServerUrl(serverList.get(position).getHost()); - editor.putString("pref_api_base", serverUrl); - editor.apply(); - - activity.finish(); +// editor.putString("pref_api_base", serverUrl); +// editor.apply(); +// +// Toast.makeText(activity, activity.getString(R.string.server_selection_set_server, serverUrl), Toast.LENGTH_LONG).show(); + Intent intent = new Intent(); + intent.putExtra("serverUrl", serverUrl); + intent.putExtra("serverName", serverList.get(position).getName()); + activity.setResult(RESULT_OK, intent); + + activity.finish(); + }); // diff --git a/app/src/main/java/net/schueller/peertube/adapter/ServerListAdapter.java b/app/src/main/java/net/schueller/peertube/adapter/ServerListAdapter.java new file mode 100644 index 0000000..f7225df --- /dev/null +++ b/app/src/main/java/net/schueller/peertube/adapter/ServerListAdapter.java @@ -0,0 +1,158 @@ +/* + * Copyright 2018 Stefan Schüller + * + * License: GPL-3.0+ + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +package net.schueller.peertube.adapter; + +import android.app.Activity; +import android.app.AlertDialog; +import android.content.Context; +import android.content.DialogInterface; +import android.content.Intent; +import android.content.SharedPreferences; +import android.preference.PreferenceManager; +import android.provider.SearchRecentSuggestions; +import android.text.TextUtils; +import android.util.Log; +import android.view.LayoutInflater; +import android.view.View; +import android.view.ViewGroup; +import android.widget.ImageView; +import android.widget.TextView; +import android.widget.Toast; + +import androidx.annotation.NonNull; +import androidx.recyclerview.widget.RecyclerView; + +import net.schueller.peertube.R; + +import net.schueller.peertube.activity.SelectServerActivity; +import net.schueller.peertube.activity.ServerAddressBookActivity; +import net.schueller.peertube.activity.VideoListActivity; +import net.schueller.peertube.database.Server; +import net.schueller.peertube.helper.APIUrlHelper; +import net.schueller.peertube.provider.SearchSuggestionsProvider; +import net.schueller.peertube.service.LoginService; + + +import java.util.List; + +import static android.app.Activity.RESULT_OK; + +public class ServerListAdapter extends RecyclerView.Adapter { + + + private final LayoutInflater mInflater; + private List mServers; // Cached copy of Servers + + public ServerListAdapter(Context context) { + this.mInflater = LayoutInflater.from(context); + } + + @NonNull + @Override + public ServerViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) { + View itemView = mInflater.inflate(R.layout.row_serverbook, parent, false); + return new ServerViewHolder(itemView); + } + + @Override + public void onBindViewHolder(@NonNull ServerViewHolder holder, int position) { + + if (mServers != null) { + Server current = mServers.get(position); + holder.serverLabel.setText(current.getServerName()); + holder.serverUrl.setText(current.getServerHost()); + + if (TextUtils.isEmpty(current.getUsername())) { + holder.hasLogin.setVisibility(View.GONE); + } else { + holder.hasLogin.setVisibility(View.VISIBLE); + } + + } else { + // Covers the case of data not being ready yet. + holder.serverLabel.setText(R.string.server_book_no_servers_found); + } + + holder.itemView.setOnClickListener(v -> { + SharedPreferences sharedPref = PreferenceManager.getDefaultSharedPreferences(mInflater.getContext()); + SharedPreferences.Editor editor = sharedPref.edit(); + + String serverUrl = APIUrlHelper.cleanServerUrl(getServerAtPosition(position).getServerHost()); + + editor.putString("pref_api_base", serverUrl); + editor.apply(); + + // attempt authentication if we have a username + if (!TextUtils.isEmpty(getServerAtPosition(position).getUsername())) { + LoginService.Authenticate( + getServerAtPosition(position).getUsername(), + getServerAtPosition(position).getPassword() + ); + } + + // tell server list activity to reload list + Intent intent = new Intent(); + ((Activity) mInflater.getContext()).setResult(RESULT_OK, intent); + + // close this activity + ((Activity) mInflater.getContext()).finish(); + + Toast.makeText(mInflater.getContext(), mInflater.getContext().getString(R.string.server_selection_set_server, serverUrl), Toast.LENGTH_LONG).show(); + + }); + + +// +// holder.itemView.setOnLongClickListener(v -> { +// Log.v("ServerListAdapter", "setOnLongClickListener " + position); +// return true; +// }); + + + } + + public void setServers(List Servers) { + mServers = Servers; + this.notifyDataSetChanged(); + } + + // getItemCount() is called many times, and when it is first called, + // mServers has not been updated (means initially, it's null, and we can't return null). + @Override + public int getItemCount() { + if (mServers != null) + return mServers.size(); + else return 0; + } + + static class ServerViewHolder extends RecyclerView.ViewHolder { + TextView serverLabel, serverUrl, serverUsername; + ImageView hasLogin; + + private ServerViewHolder(View itemView) { + super(itemView); + serverLabel = itemView.findViewById(R.id.serverLabelRow); + serverUrl = itemView.findViewById(R.id.serverUrlRow); + hasLogin = itemView.findViewById(R.id.sb_row_has_login_icon); + } + } + + public Server getServerAtPosition (int position) { + return mServers.get(position); + } +} \ No newline at end of file diff --git a/app/src/main/java/net/schueller/peertube/application/AppApplication.java b/app/src/main/java/net/schueller/peertube/application/AppApplication.java index 05869b4..98f0996 100644 --- a/app/src/main/java/net/schueller/peertube/application/AppApplication.java +++ b/app/src/main/java/net/schueller/peertube/application/AppApplication.java @@ -1,3 +1,20 @@ +/* + * Copyright 2018 Stefan Schüller + * + * License: GPL-3.0+ + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ package net.schueller.peertube.application; import android.app.Application; diff --git a/app/src/main/java/net/schueller/peertube/database/AppDatabase.java b/app/src/main/java/net/schueller/peertube/database/AppDatabase.java new file mode 100644 index 0000000..bc1643e --- /dev/null +++ b/app/src/main/java/net/schueller/peertube/database/AppDatabase.java @@ -0,0 +1,26 @@ +/* + * Copyright 2018 Stefan Schüller + * + * License: GPL-3.0+ + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +package net.schueller.peertube.database; + +import androidx.room.Database; +import androidx.room.RoomDatabase; + +@Database(entities = {Server.class}, version = 1) +public abstract class AppDatabase extends RoomDatabase { + public abstract ServerDao serverDao(); +} \ No newline at end of file diff --git a/app/src/main/java/net/schueller/peertube/database/Server.java b/app/src/main/java/net/schueller/peertube/database/Server.java new file mode 100644 index 0000000..5c0f7e1 --- /dev/null +++ b/app/src/main/java/net/schueller/peertube/database/Server.java @@ -0,0 +1,87 @@ +/* + * Copyright 2018 Stefan Schüller + * + * License: GPL-3.0+ + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +package net.schueller.peertube.database; + +import androidx.annotation.NonNull; +import androidx.room.ColumnInfo; +import androidx.room.Entity; +import androidx.room.PrimaryKey; + +@Entity(tableName = "server_table") +public class Server { + + @PrimaryKey(autoGenerate = true) + private int id; + + @NonNull + @ColumnInfo(name = "server_name") + private String serverName; + + @ColumnInfo(name = "server_host") + private String serverHost; + + @ColumnInfo(name = "username") + private String username; + + @ColumnInfo(name = "password") + private String password; + + public Server(@NonNull String serverName) { + this.serverName = serverName; + } + + public int getId() { + return id; + } + + public void setId(int id) { + this.id = id; + } + + public String getServerName() { + return serverName; + } + + public void setServerName(String serverName) { + this.serverName = serverName; + } + + public String getServerHost() { + return serverHost; + } + + public void setServerHost(String serverHost) { + this.serverHost = serverHost; + } + + public String getUsername() { + return username; + } + + public void setUsername(String username) { + this.username = username; + } + + public String getPassword() { + return password; + } + + public void setPassword(String password) { + this.password = password; + } +} diff --git a/app/src/main/java/net/schueller/peertube/database/ServerDao.java b/app/src/main/java/net/schueller/peertube/database/ServerDao.java new file mode 100644 index 0000000..e01ef5f --- /dev/null +++ b/app/src/main/java/net/schueller/peertube/database/ServerDao.java @@ -0,0 +1,43 @@ +/* + * Copyright 2018 Stefan Schüller + * + * License: GPL-3.0+ + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +package net.schueller.peertube.database; + +import androidx.lifecycle.LiveData; +import androidx.room.Dao; +import androidx.room.Delete; +import androidx.room.Insert; +import androidx.room.OnConflictStrategy; +import androidx.room.Query; + +import java.util.List; + +@Dao +public interface ServerDao { + + @Insert(onConflict = OnConflictStrategy.REPLACE) + void insert(Server server); + + @Query("DELETE FROM server_table") + void deleteAll(); + + @Delete + void delete(Server server); + + @Query("SELECT * from server_table ORDER BY server_name DESC") + LiveData> getAllServers(); +} \ No newline at end of file diff --git a/app/src/main/java/net/schueller/peertube/database/ServerRepository.java b/app/src/main/java/net/schueller/peertube/database/ServerRepository.java new file mode 100644 index 0000000..001cb7c --- /dev/null +++ b/app/src/main/java/net/schueller/peertube/database/ServerRepository.java @@ -0,0 +1,80 @@ +/* + * Copyright 2018 Stefan Schüller + * + * License: GPL-3.0+ + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +package net.schueller.peertube.database; + +import android.app.Application; +import android.os.AsyncTask; + + +import androidx.lifecycle.LiveData; + +import java.util.List; + +class ServerRepository { + + private ServerDao mServerDao; + private LiveData> mAllServers; + + ServerRepository(Application application) { + ServerRoomDatabase db = ServerRoomDatabase.getDatabase(application); + mServerDao = db.serverDao(); + mAllServers = mServerDao.getAllServers(); + + } + + LiveData> getAllServers() { + return mAllServers; + } + + void insert (Server server) { + new insertAsyncTask(mServerDao).execute(server); + } + + public void delete(Server server) { + new deleteServerAsyncTask(mServerDao).execute(server); + } + + private static class insertAsyncTask extends AsyncTask { + + private ServerDao mAsyncTaskDao; + + insertAsyncTask(ServerDao dao) { + mAsyncTaskDao = dao; + } + + @Override + protected Void doInBackground(final Server... params) { + mAsyncTaskDao.insert(params[0]); + return null; + } + } + + private static class deleteServerAsyncTask extends AsyncTask { + private ServerDao mAsyncTaskDao; + + deleteServerAsyncTask(ServerDao dao) { + mAsyncTaskDao = dao; + } + + @Override + protected Void doInBackground(final Server... params) { + mAsyncTaskDao.delete(params[0]); + return null; + } + } +} diff --git a/app/src/main/java/net/schueller/peertube/database/ServerRoomDatabase.java b/app/src/main/java/net/schueller/peertube/database/ServerRoomDatabase.java new file mode 100644 index 0000000..deb79a2 --- /dev/null +++ b/app/src/main/java/net/schueller/peertube/database/ServerRoomDatabase.java @@ -0,0 +1,57 @@ +/* + * Copyright 2018 Stefan Schüller + * + * License: GPL-3.0+ + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +package net.schueller.peertube.database; + +import android.content.Context; + +import androidx.room.Database; +import androidx.room.Room; +import androidx.room.RoomDatabase; + +import java.util.concurrent.ExecutorService; +import java.util.concurrent.Executors; + +@Database(entities = {Server.class}, version = 1, exportSchema = false) +public abstract class ServerRoomDatabase extends RoomDatabase { + + public abstract ServerDao serverDao(); + + private static volatile ServerRoomDatabase INSTANCE; + + private static final int NUMBER_OF_THREADS = 4; + + static final ExecutorService databaseWriteExecutor = + Executors.newFixedThreadPool(NUMBER_OF_THREADS); + + public static ServerRoomDatabase getDatabase(final Context context) { + if (INSTANCE == null) { + synchronized (ServerRoomDatabase.class) { + if (INSTANCE == null) { + if (INSTANCE == null) { + INSTANCE = Room.databaseBuilder(context.getApplicationContext(), + ServerRoomDatabase.class, "server_database") + .build(); + } + } + } + } + return INSTANCE; + } + +} + diff --git a/app/src/main/java/net/schueller/peertube/database/ServerViewModel.java b/app/src/main/java/net/schueller/peertube/database/ServerViewModel.java new file mode 100644 index 0000000..bdd9b1c --- /dev/null +++ b/app/src/main/java/net/schueller/peertube/database/ServerViewModel.java @@ -0,0 +1,45 @@ +/* + * Copyright 2018 Stefan Schüller + * + * License: GPL-3.0+ + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +package net.schueller.peertube.database; + +import android.app.Application; + +import androidx.lifecycle.AndroidViewModel; +import androidx.lifecycle.LiveData; + +import java.util.List; + +public class ServerViewModel extends AndroidViewModel { + + private ServerRepository mRepository; + + private LiveData> mAllServers; + + public ServerViewModel (Application application) { + super(application); + mRepository = new ServerRepository(application); + mAllServers = mRepository.getAllServers(); + } + + public LiveData> getAllServers() { return mAllServers; } + + public void insert(Server server) { mRepository.insert(server); } + + public void delete(Server server) {mRepository.delete(server);} + +} diff --git a/app/src/main/java/net/schueller/peertube/fragment/AddServerFragment.java b/app/src/main/java/net/schueller/peertube/fragment/AddServerFragment.java new file mode 100644 index 0000000..6e15a2b --- /dev/null +++ b/app/src/main/java/net/schueller/peertube/fragment/AddServerFragment.java @@ -0,0 +1,178 @@ +/* + * Copyright 2018 Stefan Schüller + * + * License: GPL-3.0+ + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +package net.schueller.peertube.fragment; + +import android.app.Activity; +import android.content.Context; +import android.content.Intent; +import android.net.Uri; +import android.os.Bundle; + +import androidx.annotation.NonNull; +import androidx.fragment.app.Fragment; + +import android.text.TextUtils; +import android.util.Log; +import android.util.Patterns; +import android.view.LayoutInflater; +import android.view.View; +import android.view.ViewGroup; +import android.view.inputmethod.InputMethodManager; +import android.widget.Button; +import android.widget.EditText; +import android.widget.Toast; + +import net.schueller.peertube.R; +import net.schueller.peertube.activity.SelectServerActivity; +import net.schueller.peertube.activity.ServerAddressBookActivity; +import net.schueller.peertube.helper.APIUrlHelper; + +import static android.app.Activity.RESULT_OK; + + +public class AddServerFragment extends Fragment { + + public static final String TAG = "AddServerFragment"; + public static final Integer PICK_SERVER = 1; + + private OnFragmentInteractionListener mListener; + + private View mView; + + public AddServerFragment() { + // Required empty public constructor + } + + @Override + public void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + + } + + @Override + public View onCreateView(LayoutInflater inflater, ViewGroup container, + Bundle savedInstanceState) { + Log.d(TAG, "onCreateView"); + // Inflate the layout for this fragment + + mView = inflater.inflate(R.layout.fragment_add_server, container, false); + + // bind button click + Button addServerButton = mView.findViewById(R.id.addServerButton); + addServerButton.setOnClickListener(view -> { + + Activity act = getActivity(); + + Boolean formValid = true; + + // close keyboard + try { + InputMethodManager inputManager = (InputMethodManager) + act.getSystemService(Context.INPUT_METHOD_SERVICE); + + inputManager.hideSoftInputFromWindow(act.getCurrentFocus().getWindowToken(), + InputMethodManager.HIDE_NOT_ALWAYS); + } catch (Exception e) { + + } + + EditText selectedLabel = mView.findViewById(R.id.serverLabel); + if ( TextUtils.isEmpty(selectedLabel.getText())){ + selectedLabel.setError( act.getString(R.string.server_book_label_is_required )); + Toast.makeText(act, R.string.invalid_url, Toast.LENGTH_LONG).show(); + formValid = false; + } + + // validate url + EditText selectedUrl = mView.findViewById(R.id.serverUrl); + String serverUrl = APIUrlHelper.cleanServerUrl(selectedUrl.getText().toString()); + selectedUrl.setText(serverUrl); + + if (!Patterns.WEB_URL.matcher(serverUrl).matches()) { + selectedUrl.setError( act.getString(R.string.server_book_valid_url_is_required ) ); + Toast.makeText(act, R.string.invalid_url, Toast.LENGTH_LONG).show(); + formValid = false; + } + + if (formValid) { + if (act instanceof ServerAddressBookActivity) { + ((ServerAddressBookActivity) act).addServer(mView); + + } + } + + }); + +// Button testServerButton = mView.findViewById(R.id.testServerButton); +// testServerButton.setOnClickListener(view -> { +// Activity act = getActivity(); +// if (act instanceof ServerAddressBookActivity) { +// ((ServerAddressBookActivity) act).testServer(); +// } +// }); + + Button pickServerUrl = mView.findViewById(R.id.pickServerUrl); + pickServerUrl.setOnClickListener(view -> { + Intent intentServer = new Intent(getActivity(), SelectServerActivity.class); + this.startActivityForResult(intentServer, PICK_SERVER); + }); + + return mView; + } + + public void onActivityResult(int requestCode, int resultCode, Intent data) { + super.onActivityResult(requestCode, resultCode, data); + if (requestCode == PICK_SERVER) { + if(resultCode == RESULT_OK) { + + String serverUrlTest = data.getStringExtra("serverUrl"); + //Log.d(TAG, "serverUrl " + serverUrlTest); + EditText serverUrl = mView.findViewById(R.id.serverUrl); + serverUrl.setText(serverUrlTest); + + EditText serverLabel = mView.findViewById(R.id.serverLabel); + if ("".equals(serverLabel.getText().toString())) { + serverLabel.setText(data.getStringExtra("serverName")); + } + + } + } + } + + @Override + public void onAttach(@NonNull Context context) { + super.onAttach(context); + if (context instanceof OnFragmentInteractionListener) { + mListener = (OnFragmentInteractionListener) context; + } else { + throw new RuntimeException(context.toString() + + " must implement OnFragmentInteractionListener"); + } + } + + @Override + public void onDetach() { + super.onDetach(); + mListener = null; + } + + public interface OnFragmentInteractionListener { + // TODO: Update argument type and name + void onFragmentInteraction(Uri uri); + } +} diff --git a/app/src/main/java/net/schueller/peertube/activity/LoginActivity.java b/app/src/main/java/net/schueller/peertube/service/LoginService.java similarity index 50% rename from app/src/main/java/net/schueller/peertube/activity/LoginActivity.java rename to app/src/main/java/net/schueller/peertube/service/LoginService.java index df0a6df..6891c92 100644 --- a/app/src/main/java/net/schueller/peertube/activity/LoginActivity.java +++ b/app/src/main/java/net/schueller/peertube/service/LoginService.java @@ -15,23 +15,15 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ - -package net.schueller.peertube.activity; +package net.schueller.peertube.service; import android.content.Context; -import android.content.Intent; import android.content.SharedPreferences; import android.preference.PreferenceManager; -import android.os.Bundle; -import android.text.InputType; import android.util.Log; -import android.widget.AutoCompleteTextView; -import android.widget.Button; -import android.widget.EditText; import android.widget.Toast; -import com.mikepenz.fontawesome_typeface_library.FontAwesome; -import com.mikepenz.iconics.IconicsDrawable; +import androidx.annotation.NonNull; import net.schueller.peertube.R; import net.schueller.peertube.helper.APIUrlHelper; @@ -40,88 +32,23 @@ import net.schueller.peertube.model.Token; import net.schueller.peertube.network.AuthenticationService; import net.schueller.peertube.network.RetrofitInstance; -import androidx.annotation.NonNull; -import androidx.appcompat.widget.Toolbar; import retrofit2.Call; import retrofit2.Callback; import retrofit2.Response; -public class LoginActivity extends CommonActivity { +import static net.schueller.peertube.application.AppApplication.getContext; - private String TAG = "LoginActivity"; +public class LoginService { - // UI references. - private AutoCompleteTextView mEmailView; - private EditText mPasswordView; + private static final String TAG = "LoginService"; - @Override - protected void onCreate(Bundle savedInstanceState) { - super.onCreate(savedInstanceState); + public static void Authenticate(String username, String password) + { + Context context = getContext(); - setContentView(R.layout.activity_login); + String apiBaseURL = APIUrlHelper.getUrlWithVersion(context); - // bind button click - Button mEmailSignInButton = findViewById(R.id.email_sign_in_button); - mEmailSignInButton.setOnClickListener(view -> attemptLogin()); - - mEmailView = findViewById(R.id.email); - mPasswordView = findViewById(R.id.password); - - - // Attaching the layout to the toolbar object - Toolbar toolbar = findViewById(R.id.tool_bar_login); - // Setting toolbar as the ActionBar with setSupportActionBar() call - setSupportActionBar(toolbar); - getSupportActionBar().setDisplayHomeAsUpEnabled(true); - getSupportActionBar().setHomeAsUpIndicator( - new IconicsDrawable(this, FontAwesome.Icon.faw_chevron_left).actionBar() - ); - - } - - @Override - public void onResume() { - - EditText mServerName = findViewById(R.id.login_current_server); - mServerName.setText(APIUrlHelper.getUrl(this)); - mServerName.setInputType(InputType.TYPE_NULL); - - super.onResume(); - } - - @Override - public boolean onSupportNavigateUp() { - finish(); // close this activity as oppose to navigating up - - return false; - } - - private void attemptLogin() { - - SharedPreferences sharedPref = PreferenceManager.getDefaultSharedPreferences(this); - - Context context = this; - - // Reset errors. - mEmailView.setError(null); - mPasswordView.setError(null); - - // Store values at the time of the login attempt. - String email = mEmailView.getText().toString(); - String password = mPasswordView.getText().toString(); - - //check values - if (email.isEmpty()) { - Toast.makeText(LoginActivity.this, "Email/Username is empty", Toast.LENGTH_LONG).show(); - return; - } - if (password.isEmpty()) { - Toast.makeText(LoginActivity.this, "Password is empty", Toast.LENGTH_LONG).show(); - return; - } - // make http call to login and save access tokens - - String apiBaseURL = APIUrlHelper.getUrlWithVersion(this); + SharedPreferences sharedPref = PreferenceManager.getDefaultSharedPreferences(context); AuthenticationService service = RetrofitInstance.getRetrofitInstance(apiBaseURL).create(AuthenticationService.class); @@ -141,7 +68,7 @@ public class LoginActivity extends CommonActivity { "code", "password", "upload", - email, + username, password ); call2.enqueue(new Callback() { @@ -157,23 +84,19 @@ public class LoginActivity extends CommonActivity { // TODO: calc expiration //editor.putInt(getString(R.string.pref_token_expiration), token.getRefreshToken()); - editor.putString(getString(R.string.pref_token_access), token.getAccessToken()); - editor.putString(getString(R.string.pref_token_refresh), token.getExpiresIn()); - editor.putString(getString(R.string.pref_token_type), token.getTokenType()); - editor.commit(); + editor.putString(context.getString(R.string.pref_token_access), token.getAccessToken()); + editor.putString(context.getString(R.string.pref_token_refresh), token.getExpiresIn()); + editor.putString(context.getString(R.string.pref_token_type), token.getTokenType()); + editor.apply(); Log.wtf(TAG, "Logged in"); - Intent intent = new Intent(context, MeActivity.class); - intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP); - context.startActivity(intent); + Toast.makeText(context, context.getString(R.string.authentication_login_success), Toast.LENGTH_LONG).show(); - finish(); // close this activity } else { Log.wtf(TAG, response2.toString()); - - Toast.makeText(LoginActivity.this, "Login Error!", Toast.LENGTH_LONG).show(); + Toast.makeText(context, context.getString(R.string.authentication_login_failed), Toast.LENGTH_LONG).show(); } } @@ -181,21 +104,24 @@ public class LoginActivity extends CommonActivity { @Override public void onFailure(@NonNull Call call2, @NonNull Throwable t2) { Log.wtf("err", t2.fillInStackTrace()); + Toast.makeText(context, context.getString(R.string.authentication_login_failed), Toast.LENGTH_LONG).show(); + } }); } else { Log.wtf(TAG, response.toString()); + Toast.makeText(context, context.getString(R.string.authentication_login_failed), Toast.LENGTH_LONG).show(); + } } @Override public void onFailure(@NonNull Call call, @NonNull Throwable t) { Log.wtf("err", t.fillInStackTrace()); + Toast.makeText(context, context.getString(R.string.authentication_login_failed), Toast.LENGTH_LONG).show(); + } }); } - - } - diff --git a/app/src/main/res/anim/slide_in_bottom.xml b/app/src/main/res/anim/slide_in_bottom.xml new file mode 100644 index 0000000..da3edb3 --- /dev/null +++ b/app/src/main/res/anim/slide_in_bottom.xml @@ -0,0 +1,6 @@ + + \ No newline at end of file diff --git a/app/src/main/res/anim/slide_out_bottom.xml b/app/src/main/res/anim/slide_out_bottom.xml new file mode 100644 index 0000000..737b8cf --- /dev/null +++ b/app/src/main/res/anim/slide_out_bottom.xml @@ -0,0 +1,6 @@ + + \ No newline at end of file diff --git a/app/src/main/res/drawable/ic_baseline_account_circle_24.xml b/app/src/main/res/drawable/ic_baseline_account_circle_24.xml new file mode 100644 index 0000000..89199eb --- /dev/null +++ b/app/src/main/res/drawable/ic_baseline_account_circle_24.xml @@ -0,0 +1,10 @@ + + + diff --git a/app/src/main/res/drawable/ic_baseline_add_24.xml b/app/src/main/res/drawable/ic_baseline_add_24.xml new file mode 100644 index 0000000..eb23254 --- /dev/null +++ b/app/src/main/res/drawable/ic_baseline_add_24.xml @@ -0,0 +1,10 @@ + + + diff --git a/app/src/main/res/drawable/ic_baseline_close_24.xml b/app/src/main/res/drawable/ic_baseline_close_24.xml new file mode 100644 index 0000000..16d6d37 --- /dev/null +++ b/app/src/main/res/drawable/ic_baseline_close_24.xml @@ -0,0 +1,10 @@ + + + diff --git a/app/src/main/res/drawable/ic_baseline_help_24.xml b/app/src/main/res/drawable/ic_baseline_help_24.xml new file mode 100644 index 0000000..c0c9268 --- /dev/null +++ b/app/src/main/res/drawable/ic_baseline_help_24.xml @@ -0,0 +1,10 @@ + + + diff --git a/app/src/main/res/drawable/ic_baseline_person_pin_24.xml b/app/src/main/res/drawable/ic_baseline_person_pin_24.xml new file mode 100644 index 0000000..fd6018c --- /dev/null +++ b/app/src/main/res/drawable/ic_baseline_person_pin_24.xml @@ -0,0 +1,10 @@ + + + diff --git a/app/src/main/res/drawable/ic_baseline_settings_24.xml b/app/src/main/res/drawable/ic_baseline_settings_24.xml new file mode 100644 index 0000000..41a82ed --- /dev/null +++ b/app/src/main/res/drawable/ic_baseline_settings_24.xml @@ -0,0 +1,10 @@ + + + diff --git a/app/src/main/res/drawable/ic_baseline_video_library_24.xml b/app/src/main/res/drawable/ic_baseline_video_library_24.xml new file mode 100644 index 0000000..2259eaf --- /dev/null +++ b/app/src/main/res/drawable/ic_baseline_video_library_24.xml @@ -0,0 +1,10 @@ + + + diff --git a/app/src/main/res/layout/activity_login.xml b/app/src/main/res/layout/activity_login.xml deleted file mode 100644 index 781f51b..0000000 --- a/app/src/main/res/layout/activity_login.xml +++ /dev/null @@ -1,113 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -