mirror of
https://framagit.org/tom79/fedilab-tube
synced 2025-02-16 12:00:42 +01:00
Merge branch 'develop' into new_feature
# Conflicts: # app/src/main/java/app/fedilab/fedilabtube/drawer/PeertubeAdapter.java # app/src/main/java/app/fedilab/fedilabtube/helper/Helper.java
This commit is contained in:
commit
8377f9bb8a
@ -116,7 +116,7 @@ dependencies {
|
||||
implementation "net.gotev:uploadservice-okhttp:3.5.2"
|
||||
implementation "com.google.code.gson:gson:2.8.6"
|
||||
implementation 'androidx.media:media:1.2.0'
|
||||
|
||||
implementation 'com.github.ybq:Android-SpinKit:1.4.0'
|
||||
implementation 'com.squareup.retrofit2:retrofit:2.9.0'
|
||||
implementation 'com.squareup.retrofit2:converter-gson:2.9.0'
|
||||
|
||||
|
@ -201,7 +201,7 @@
|
||||
</string-array>
|
||||
|
||||
<string name="set_cache_mode">Cache</string>
|
||||
<string name="set_video_cache_description">Set the cache for videos (default 100Mb)</string>
|
||||
<string name="set_video_cache_description">Définir le cache pour les vidéos (défaut 100Mo)</string>
|
||||
<string name="video_cache_value">Cache pour les vidéos: %d Mo</string>
|
||||
<string name="set_video_mode_choice" translatable="false">set_video_mode_choice</string>
|
||||
<string name="set_video_minimize_choice" translatable="false">set_video_minimize_choice</string>
|
||||
|
@ -15,4 +15,7 @@
|
||||
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
|
||||
<item name="colorAccent">@color/colorAccent</item>
|
||||
</style>
|
||||
|
||||
<style name="progress" parent="SpinKitView.Circle" />
|
||||
<style name="progressBottom" parent="SpinKitView.ThreeBounce" />
|
||||
</resources>
|
@ -1,4 +1,4 @@
|
||||
- Force le mode paysage lors du passage en mode plein écran
|
||||
- Modifier la valeur du cache pour les vidéos
|
||||
- Définir la résolution pour les vidéos
|
||||
- Définir la résolution par défaut pour les vidéos
|
||||
- Correction de bugs
|
@ -1,6 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources xmlns:tools="http://schemas.android.com/tools">
|
||||
<string name="title_home">Home</string>
|
||||
<string name="title_local">Local</string>
|
||||
<string name="title_discover">Discover</string>
|
||||
<string name="title_notifications">Notifications</string>
|
||||
<string name="title_recently_added">Recently added</string>
|
||||
@ -103,8 +104,13 @@
|
||||
<string name="change_instance">Pick another instance</string>
|
||||
<string name="my_history">History</string>
|
||||
<string name="edit">Edit</string>
|
||||
<string name="video_settings">Video settings</string>
|
||||
<string name="app_interface">Interface</string>
|
||||
<string name="set_cache_mode">Cache</string>
|
||||
<string name="set_video_cache_description">Set the cache for videos (default 100Mb)</string>
|
||||
<string name="set_video_quality_description">Define a default quality for videos</string>
|
||||
<string name="set_quality_mode">Resolution for videos</string>
|
||||
<string name="video_cache_value">Video cache: %d Mb</string>
|
||||
<string name="captions">Captions</string>
|
||||
<string name="pickup_captions">Pick captions</string>
|
||||
<string name="none">None</string>
|
||||
|
@ -1,6 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources xmlns:tools="http://schemas.android.com/tools">
|
||||
<string name="title_home">Startseite</string>
|
||||
<string name="title_local">Local</string>
|
||||
<string name="title_discover">Mehr erfahren</string>
|
||||
<string name="title_notifications">Benachrichtigungen</string>
|
||||
<string name="title_recently_added">Zuletzt hinzugefügt</string>
|
||||
@ -103,8 +104,13 @@
|
||||
<string name="change_instance">Wähle eine andere Instanz</string>
|
||||
<string name="my_history">Verlauf</string>
|
||||
<string name="edit">Bearbeiten</string>
|
||||
<string name="video_settings">Video settings</string>
|
||||
<string name="app_interface">Interface</string>
|
||||
<string name="set_cache_mode">Cache</string>
|
||||
<string name="set_video_cache_description">Set the cache for videos (default 100Mb)</string>
|
||||
<string name="set_video_quality_description">Define a default quality for videos</string>
|
||||
<string name="set_quality_mode">Resolution for videos</string>
|
||||
<string name="video_cache_value">Video cache: %d Mb</string>
|
||||
<string name="captions">Untertitel</string>
|
||||
<string name="pickup_captions">Untertitel abholen</string>
|
||||
<string name="none">Keine</string>
|
||||
|
@ -1,6 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources xmlns:tools="http://schemas.android.com/tools">
|
||||
<string name="title_home">Αρχική</string>
|
||||
<string name="title_local">Local</string>
|
||||
<string name="title_discover">Ανακαλύψτε</string>
|
||||
<string name="title_notifications">Ειδοποιήσεις</string>
|
||||
<string name="title_recently_added">Προστέθηκαν πρόσφατα</string>
|
||||
@ -103,8 +104,13 @@
|
||||
<string name="change_instance">Επιλογή άλλης υπόστασης</string>
|
||||
<string name="my_history">Ιστορικό</string>
|
||||
<string name="edit">Επεξεργασία</string>
|
||||
<string name="video_settings">Video settings</string>
|
||||
<string name="app_interface">Interface</string>
|
||||
<string name="set_cache_mode">Cache</string>
|
||||
<string name="set_video_cache_description">Set the cache for videos (default 100Mb)</string>
|
||||
<string name="set_video_quality_description">Define a default quality for videos</string>
|
||||
<string name="set_quality_mode">Resolution for videos</string>
|
||||
<string name="video_cache_value">Video cache: %d Mb</string>
|
||||
<string name="captions">Υπότιτλοι</string>
|
||||
<string name="pickup_captions">Επιλογή υποτίτλων</string>
|
||||
<string name="none">Κανένας</string>
|
||||
|
@ -1,6 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources xmlns:tools="http://schemas.android.com/tools">
|
||||
<string name="title_home">Inicio</string>
|
||||
<string name="title_local">Local</string>
|
||||
<string name="title_discover">Descubre</string>
|
||||
<string name="title_notifications">Notificaciones</string>
|
||||
<string name="title_recently_added">Añadido recientemente</string>
|
||||
@ -103,8 +104,13 @@
|
||||
<string name="change_instance">Selecciona otra instancia</string>
|
||||
<string name="my_history">Historia</string>
|
||||
<string name="edit">Editar</string>
|
||||
<string name="video_settings">Video settings</string>
|
||||
<string name="app_interface">Interface</string>
|
||||
<string name="set_cache_mode">Cache</string>
|
||||
<string name="set_video_cache_description">Set the cache for videos (default 100Mb)</string>
|
||||
<string name="set_video_quality_description">Define a default quality for videos</string>
|
||||
<string name="set_quality_mode">Resolution for videos</string>
|
||||
<string name="video_cache_value">Video cache: %d Mb</string>
|
||||
<string name="captions">Subtítulos</string>
|
||||
<string name="pickup_captions">Pies de foto de la camioneta</string>
|
||||
<string name="none">Ninguno</string>
|
||||
|
@ -1,6 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources xmlns:tools="http://schemas.android.com/tools">
|
||||
<string name="title_home">Locale</string>
|
||||
<string name="title_local">Local</string>
|
||||
<string name="title_discover">Découvrir</string>
|
||||
<string name="title_notifications">Notifications</string>
|
||||
<string name="title_recently_added">Nouveautés</string>
|
||||
@ -16,7 +17,7 @@
|
||||
<string name="instance_choice">Choisissez une instance</string>
|
||||
<string name="not_valide_instance">Cette instance ne semble pas être valide !</string>
|
||||
<string name="no_videos">Aucune vidéo !</string>
|
||||
<string name="no_notifications">No notifications!</string>
|
||||
<string name="no_notifications">Aucune notification !</string>
|
||||
<string name="favicon">Favicon</string>
|
||||
<string name="open_with">Ouvrir avec</string>
|
||||
<string name="action_playlist_edit">Modifier une liste de lecture</string>
|
||||
@ -103,8 +104,13 @@
|
||||
<string name="change_instance">Changer d\'instance</string>
|
||||
<string name="my_history">Historique</string>
|
||||
<string name="edit">Modifier</string>
|
||||
<string name="video_settings">Video settings</string>
|
||||
<string name="app_interface">Interface</string>
|
||||
<string name="set_cache_mode">Cache</string>
|
||||
<string name="set_video_cache_description">Set the cache for videos (default 100Mb)</string>
|
||||
<string name="set_video_quality_description">Define a default quality for videos</string>
|
||||
<string name="set_quality_mode">Resolution for videos</string>
|
||||
<string name="video_cache_value">Video cache: %d Mb</string>
|
||||
<string name="captions">Légendes</string>
|
||||
<string name="pickup_captions">Options d\'envoi</string>
|
||||
<string name="none">Aucune</string>
|
||||
|
@ -1,6 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources xmlns:tools="http://schemas.android.com/tools">
|
||||
<string name="title_home">Inizio</string>
|
||||
<string name="title_local">Local</string>
|
||||
<string name="title_discover">Esplora</string>
|
||||
<string name="title_notifications">Notifiche</string>
|
||||
<string name="title_recently_added">Aggiunti di recente</string>
|
||||
@ -103,8 +104,13 @@
|
||||
<string name="change_instance">Prendi un\'altra istanza</string>
|
||||
<string name="my_history">Cronologia</string>
|
||||
<string name="edit">Modifica</string>
|
||||
<string name="video_settings">Video settings</string>
|
||||
<string name="app_interface">Interface</string>
|
||||
<string name="set_cache_mode">Cache</string>
|
||||
<string name="set_video_cache_description">Set the cache for videos (default 100Mb)</string>
|
||||
<string name="set_video_quality_description">Define a default quality for videos</string>
|
||||
<string name="set_quality_mode">Resolution for videos</string>
|
||||
<string name="video_cache_value">Video cache: %d Mb</string>
|
||||
<string name="captions">Didascalie</string>
|
||||
<string name="pickup_captions">Scegliere le didascalie</string>
|
||||
<string name="none">Nessuno</string>
|
||||
|
@ -1,6 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources xmlns:tools="http://schemas.android.com/tools">
|
||||
<string name="title_home">ホーム</string>
|
||||
<string name="title_local">Local</string>
|
||||
<string name="title_discover">発見</string>
|
||||
<string name="title_notifications">通知</string>
|
||||
<string name="title_recently_added">最近追加された項目</string>
|
||||
@ -103,8 +104,13 @@
|
||||
<string name="change_instance">Pick another instance</string>
|
||||
<string name="my_history">履歴</string>
|
||||
<string name="edit">編集</string>
|
||||
<string name="video_settings">Video settings</string>
|
||||
<string name="app_interface">Interface</string>
|
||||
<string name="set_cache_mode">Cache</string>
|
||||
<string name="set_video_cache_description">Set the cache for videos (default 100Mb)</string>
|
||||
<string name="set_video_quality_description">Define a default quality for videos</string>
|
||||
<string name="set_quality_mode">Resolution for videos</string>
|
||||
<string name="video_cache_value">Video cache: %d Mb</string>
|
||||
<string name="captions">字幕</string>
|
||||
<string name="pickup_captions">字幕を選択</string>
|
||||
<string name="none">なし</string>
|
||||
|
@ -1,6 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources xmlns:tools="http://schemas.android.com/tools">
|
||||
<string name="title_home">Home</string>
|
||||
<string name="title_local">Local</string>
|
||||
<string name="title_discover">Discover</string>
|
||||
<string name="title_notifications">Notifications</string>
|
||||
<string name="title_recently_added">Recently added</string>
|
||||
@ -103,8 +104,13 @@
|
||||
<string name="change_instance">Pick another instance</string>
|
||||
<string name="my_history">History</string>
|
||||
<string name="edit">Edit</string>
|
||||
<string name="video_settings">Video settings</string>
|
||||
<string name="app_interface">Interface</string>
|
||||
<string name="set_cache_mode">Cache</string>
|
||||
<string name="set_video_cache_description">Set the cache for videos (default 100Mb)</string>
|
||||
<string name="set_video_quality_description">Define a default quality for videos</string>
|
||||
<string name="set_quality_mode">Resolution for videos</string>
|
||||
<string name="video_cache_value">Video cache: %d Mb</string>
|
||||
<string name="captions">Captions</string>
|
||||
<string name="pickup_captions">Pick captions</string>
|
||||
<string name="none">None</string>
|
||||
|
@ -1,6 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources xmlns:tools="http://schemas.android.com/tools">
|
||||
<string name="title_home">Home</string>
|
||||
<string name="title_local">Local</string>
|
||||
<string name="title_discover">Ontdek</string>
|
||||
<string name="title_notifications">Meldingen</string>
|
||||
<string name="title_recently_added">Onlangs toegevoegd</string>
|
||||
@ -103,8 +104,13 @@
|
||||
<string name="change_instance">Kies een andere instantie</string>
|
||||
<string name="my_history">Geschiedenis</string>
|
||||
<string name="edit">Bewerk</string>
|
||||
<string name="video_settings">Video settings</string>
|
||||
<string name="app_interface">Interface</string>
|
||||
<string name="set_cache_mode">Cache</string>
|
||||
<string name="set_video_cache_description">Set the cache for videos (default 100Mb)</string>
|
||||
<string name="set_video_quality_description">Define a default quality for videos</string>
|
||||
<string name="set_quality_mode">Resolution for videos</string>
|
||||
<string name="video_cache_value">Video cache: %d Mb</string>
|
||||
<string name="captions">Bijschriften</string>
|
||||
<string name="pickup_captions">Pick captions</string>
|
||||
<string name="none">Geen</string>
|
||||
|
@ -1,6 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources xmlns:tools="http://schemas.android.com/tools">
|
||||
<string name="title_home">Strona główna</string>
|
||||
<string name="title_local">Local</string>
|
||||
<string name="title_discover">Odkryj</string>
|
||||
<string name="title_notifications">Powiadomienia</string>
|
||||
<string name="title_recently_added">Ostatnio dodany</string>
|
||||
@ -103,8 +104,13 @@
|
||||
<string name="change_instance">Wybierz inny przypadek</string>
|
||||
<string name="my_history">Historia</string>
|
||||
<string name="edit">Edycja</string>
|
||||
<string name="video_settings">Video settings</string>
|
||||
<string name="app_interface">Interface</string>
|
||||
<string name="set_cache_mode">Cache</string>
|
||||
<string name="set_video_cache_description">Set the cache for videos (default 100Mb)</string>
|
||||
<string name="set_video_quality_description">Define a default quality for videos</string>
|
||||
<string name="set_quality_mode">Resolution for videos</string>
|
||||
<string name="video_cache_value">Video cache: %d Mb</string>
|
||||
<string name="captions">Podpisy</string>
|
||||
<string name="pickup_captions">Wybierz podpisy</string>
|
||||
<string name="none">Brak</string>
|
||||
|
@ -1,6 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources xmlns:tools="http://schemas.android.com/tools">
|
||||
<string name="title_home">Home</string>
|
||||
<string name="title_local">Local</string>
|
||||
<string name="title_discover">Discover</string>
|
||||
<string name="title_notifications">Notifications</string>
|
||||
<string name="title_recently_added">Recently added</string>
|
||||
@ -103,8 +104,13 @@
|
||||
<string name="change_instance">Pick another instance</string>
|
||||
<string name="my_history">History</string>
|
||||
<string name="edit">Edit</string>
|
||||
<string name="video_settings">Video settings</string>
|
||||
<string name="app_interface">Interface</string>
|
||||
<string name="set_cache_mode">Cache</string>
|
||||
<string name="set_video_cache_description">Set the cache for videos (default 100Mb)</string>
|
||||
<string name="set_video_quality_description">Define a default quality for videos</string>
|
||||
<string name="set_quality_mode">Resolution for videos</string>
|
||||
<string name="video_cache_value">Video cache: %d Mb</string>
|
||||
<string name="captions">Captions</string>
|
||||
<string name="pickup_captions">Pick captions</string>
|
||||
<string name="none">None</string>
|
||||
|
@ -1,6 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources xmlns:tools="http://schemas.android.com/tools">
|
||||
<string name="title_home">Home</string>
|
||||
<string name="title_local">Local</string>
|
||||
<string name="title_discover">Discover</string>
|
||||
<string name="title_notifications">Notifications</string>
|
||||
<string name="title_recently_added">Recently added</string>
|
||||
@ -103,8 +104,13 @@
|
||||
<string name="change_instance">Pick another instance</string>
|
||||
<string name="my_history">History</string>
|
||||
<string name="edit">Edit</string>
|
||||
<string name="video_settings">Video settings</string>
|
||||
<string name="app_interface">Interface</string>
|
||||
<string name="set_cache_mode">Cache</string>
|
||||
<string name="set_video_cache_description">Set the cache for videos (default 100Mb)</string>
|
||||
<string name="set_video_quality_description">Define a default quality for videos</string>
|
||||
<string name="set_quality_mode">Resolution for videos</string>
|
||||
<string name="video_cache_value">Video cache: %d Mb</string>
|
||||
<string name="captions">Captions</string>
|
||||
<string name="pickup_captions">Pick captions</string>
|
||||
<string name="none">None</string>
|
||||
|
@ -1,15 +1,16 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources xmlns:tools="http://schemas.android.com/tools">
|
||||
<string name="title_home">Главная страница</string>
|
||||
<string name="title_home">Главная</string>
|
||||
<string name="title_local">Локальные</string>
|
||||
<string name="title_discover">Подборка</string>
|
||||
<string name="title_notifications">Уведомления</string>
|
||||
<string name="title_recently_added">Недавно добавленные</string>
|
||||
<string name="title_recently_added">По добавлению</string>
|
||||
<string name="title_trending">Популярные</string>
|
||||
<string name="title_most_liked">Много лайков</string>
|
||||
<string name="toast_error">Упс! Произошла ошибка!</string>
|
||||
<string name="title_muted">Беззвучный</string>
|
||||
<string name="title_channel">Каналы</string>
|
||||
<string name="do_not_list">Не показывать</string>
|
||||
<string name="do_not_list">Скрыто</string>
|
||||
<string name="blur">Размыть</string>
|
||||
<string name="display">Показать</string>
|
||||
<string name="no_opinion">Не выбрано</string>
|
||||
@ -22,7 +23,7 @@
|
||||
<string name="action_playlist_edit">Редактировать плейлист</string>
|
||||
<string name="close">Закрыть</string>
|
||||
<string name="upload_video">Загрузить</string>
|
||||
<string name="image_preview">Предпросмотр</string>
|
||||
<string name="image_preview">Предпросмотр изображения</string>
|
||||
<string name="file_to_upload">Выберите файл для загрузки</string>
|
||||
<string name="channel">Канал</string>
|
||||
<string name="videos">Видео</string>
|
||||
@ -33,11 +34,11 @@
|
||||
<string name="download">Скачать</string>
|
||||
<string name="profile_picture">Изображение профиля</string>
|
||||
<string name="update_video">Обновить видео</string>
|
||||
<string name="date_seconds">%d с</string>
|
||||
<string name="date_minutes">%d м</string>
|
||||
<string name="date_hours">%d ч</string>
|
||||
<string name="date_day">%d д</string>
|
||||
<string name="number_view_video">%s просмотров</string>
|
||||
<string name="date_seconds">%d сек.</string>
|
||||
<string name="date_minutes">%d мин.</string>
|
||||
<string name="date_hours">%d час.</string>
|
||||
<string name="date_day">%d д.</string>
|
||||
<string name="number_view_video">Просмотры: %s</string>
|
||||
<string name="title_instance_login">Хост экземпляра</string>
|
||||
<string name="uploading">Загрузка, пожалуйста, подождите…</string>
|
||||
<string name="upload_video_success">Видео было загружено!</string>
|
||||
@ -103,12 +104,17 @@
|
||||
<string name="change_instance">Выберите другой экземпляр</string>
|
||||
<string name="my_history">История</string>
|
||||
<string name="edit">Редактировать</string>
|
||||
<string name="video_settings">Настройки видео</string>
|
||||
<string name="app_interface">Интерфейс</string>
|
||||
<string name="set_cache_mode">Кэш</string>
|
||||
<string name="set_video_cache_description">Определите кеш для видео (по умолчанию 100 Мб)</string>
|
||||
<string name="set_video_quality_description">Определить качество видео по умолчанию</string>
|
||||
<string name="set_quality_mode">Разрешение для видео</string>
|
||||
<string name="video_cache_value">Видео кэш: %d Мб</string>
|
||||
<string name="captions">Субтитры</string>
|
||||
<string name="pickup_captions">Выбрать субтитры</string>
|
||||
<string name="none">Ничто</string>
|
||||
<string name="set_video_mode_description">Позволяет изменить режим воспроизведения видео (по умолчанию, потоковой или через браузер).</string>
|
||||
<string name="set_video_mode_description">Позволяет изменить режим воспроизведения видео (по умолчанию потоковый или через браузер).</string>
|
||||
<string name="delete_video">Удалить видео</string>
|
||||
<string name="delete_video_confirmation">Вы уверены, что хотите удалить это видео?</string>
|
||||
<string name="no_video_to_display">Нет видео для отображения!</string>
|
||||
@ -120,8 +126,8 @@
|
||||
<string name="peertube_video_import_success"><![CDATA[Ваше видео <b>%1$s</b> успешно импортировано]]></string>
|
||||
<string name="peertube_video_import_error"><![CDATA[При импорте вашего видео <b>%1$s</b> произошла ошибка]]></string>
|
||||
<string name="peertube_video_from_subscription"><![CDATA[<b>%1$s</b> опубликовал новое видео: <b>%2$s</b>]]></string>
|
||||
<string name="peertube_video_blacklist"><![CDATA[Ваше видео <b>%1$s</b> занесено в черный список]]></string>
|
||||
<string name="peertube_video_unblacklist"><![CDATA[Ваше видео <b>%1$s</b> удалено из черного списка]]></string>
|
||||
<string name="peertube_video_blacklist"><![CDATA[Ваше видео <b>%1$s</b> занесено в чёрный список]]></string>
|
||||
<string name="peertube_video_unblacklist"><![CDATA[Ваше видео <b>%1$s</b> удалено из чёрного списка]]></string>
|
||||
<string name="peertube_video_abuse"><![CDATA[Новый отчёт о нарушении для видео: <b>%1$s</b>]]></string>
|
||||
<string name="add_public_comment">Добавить публичный комментарий</string>
|
||||
<string name="send_comment">Оставить комментарий</string>
|
||||
@ -201,17 +207,17 @@
|
||||
<string name="pickup_instance">Выбрать этот экземпляр</string>
|
||||
<string name="sensitive_video"> Неприличные видео</string>
|
||||
<string name="sensitive_content">Неприличный контент: %1$s</string>
|
||||
<string name="followers_instance">%1$s подписчиков у экземпляра</string>
|
||||
<string name="followers_instance">Подписчиков у экземпляра: %1$s</string>
|
||||
<string name="help">Помощь</string>
|
||||
<string name="pickup_categories">Выбрать категории</string>
|
||||
<string name="pickup_languages">Выбрать языки</string>
|
||||
<string name="notification_channel_name">Информация об обновлении</string>
|
||||
<string name="notification_channel_name">Обновить данные</string>
|
||||
<string name="add_account">Добавление аккаунта</string>
|
||||
<string name="list_of_accounts">Список аккаунтов</string>
|
||||
<string name="pause">Пауза</string>
|
||||
<string name="play">Воспроизвести</string>
|
||||
<string name="minimize">Свернуть</string>
|
||||
<string name="fast_rewind">Быстрое перемотка</string>
|
||||
<string name="fast_rewind">Быстрая перемотка</string>
|
||||
<string name="fast_forward">Перемотка вперед</string>
|
||||
<string name="set_video_minimize">Вид свёрнутого видео</string>
|
||||
<string name="set_video_minimize_description">Уменьшить размер видео, когда приложение находится в фоновом режиме (Android N+)</string>
|
||||
|
@ -1,6 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources xmlns:tools="http://schemas.android.com/tools">
|
||||
<string name="title_home">Home</string>
|
||||
<string name="title_local">Local</string>
|
||||
<string name="title_discover">Discover</string>
|
||||
<string name="title_notifications">Notifications</string>
|
||||
<string name="title_recently_added">Recently added</string>
|
||||
@ -103,8 +104,13 @@
|
||||
<string name="change_instance">Pick another instance</string>
|
||||
<string name="my_history">History</string>
|
||||
<string name="edit">Edit</string>
|
||||
<string name="video_settings">Video settings</string>
|
||||
<string name="app_interface">Interface</string>
|
||||
<string name="set_cache_mode">Cache</string>
|
||||
<string name="set_video_cache_description">Set the cache for videos (default 100Mb)</string>
|
||||
<string name="set_video_quality_description">Define a default quality for videos</string>
|
||||
<string name="set_quality_mode">Resolution for videos</string>
|
||||
<string name="video_cache_value">Video cache: %d Mb</string>
|
||||
<string name="captions">Captions</string>
|
||||
<string name="pickup_captions">Pick captions</string>
|
||||
<string name="none">None</string>
|
||||
|
@ -1,6 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources xmlns:tools="http://schemas.android.com/tools">
|
||||
<string name="title_home">Home</string>
|
||||
<string name="title_local">Local</string>
|
||||
<string name="title_discover">Discover</string>
|
||||
<string name="title_notifications">Notifications</string>
|
||||
<string name="title_recently_added">Recently added</string>
|
||||
@ -103,8 +104,13 @@
|
||||
<string name="change_instance">Pick another instance</string>
|
||||
<string name="my_history">History</string>
|
||||
<string name="edit">Edit</string>
|
||||
<string name="video_settings">Video settings</string>
|
||||
<string name="app_interface">Interface</string>
|
||||
<string name="set_cache_mode">Cache</string>
|
||||
<string name="set_video_cache_description">Set the cache for videos (default 100Mb)</string>
|
||||
<string name="set_video_quality_description">Define a default quality for videos</string>
|
||||
<string name="set_quality_mode">Resolution for videos</string>
|
||||
<string name="video_cache_value">Video cache: %d Mb</string>
|
||||
<string name="captions">Captions</string>
|
||||
<string name="pickup_captions">Pick captions</string>
|
||||
<string name="none">None</string>
|
||||
|
@ -1,6 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources xmlns:tools="http://schemas.android.com/tools">
|
||||
<string name="title_home">Home</string>
|
||||
<string name="title_local">Local</string>
|
||||
<string name="title_discover">Discover</string>
|
||||
<string name="title_notifications">Notifications</string>
|
||||
<string name="title_recently_added">Recently added</string>
|
||||
@ -103,8 +104,13 @@
|
||||
<string name="change_instance">Pick another instance</string>
|
||||
<string name="my_history">History</string>
|
||||
<string name="edit">Edit</string>
|
||||
<string name="video_settings">Video settings</string>
|
||||
<string name="app_interface">Interface</string>
|
||||
<string name="set_cache_mode">Cache</string>
|
||||
<string name="set_video_cache_description">Set the cache for videos (default 100Mb)</string>
|
||||
<string name="set_video_quality_description">Define a default quality for videos</string>
|
||||
<string name="set_quality_mode">Resolution for videos</string>
|
||||
<string name="video_cache_value">Video cache: %d Mb</string>
|
||||
<string name="captions">Captions</string>
|
||||
<string name="pickup_captions">Pick captions</string>
|
||||
<string name="none">None</string>
|
||||
|
@ -145,7 +145,7 @@
|
||||
<string name="set_video_quality_choice" translatable="false">set_video_quality_choice</string>
|
||||
<string name="set_video_cache_choice" translatable="false">set_video_cache_choice</string>
|
||||
<string name="set_cache_mode">Cache</string>
|
||||
<string name="set_video_cache_description">Définir le cache pour les vidéos (défaut 100Mo)</string>
|
||||
<string name="set_video_cache_description">Set the cache for videos (default 100Mb)</string>
|
||||
<string name="set_video_quality_description">Define a default quality for videos</string>
|
||||
<string name="set_quality_mode">Resolution for videos</string>
|
||||
<string name="video_cache_value">Video cache: %d Mb</string>
|
||||
|
@ -14,4 +14,8 @@
|
||||
<item name="colorPrimaryDark">@color/colorPrimaryDark_full</item>
|
||||
<item name="colorAccent">@color/colorAccent_full</item>
|
||||
</style>
|
||||
|
||||
<style name="progress" parent="SpinKitView.Circle" />
|
||||
|
||||
<style name="progressBottom" parent="SpinKitView.ThreeBounce" />
|
||||
</resources>
|
@ -215,7 +215,7 @@ public class AccountActivity extends AppCompatActivity {
|
||||
|
||||
AlertDialog.Builder builderSingle = new AlertDialog.Builder(AccountActivity.this);
|
||||
builderSingle.setTitle(getString(R.string.list_of_accounts));
|
||||
if( accounts != null) {
|
||||
if (accounts != null) {
|
||||
final OwnAccountsAdapter accountsListAdapter = new OwnAccountsAdapter(AccountActivity.this, accounts);
|
||||
final Account[] accountArray = new Account[accounts.size()];
|
||||
int i = 0;
|
||||
|
@ -354,7 +354,7 @@ public class AllPlaylistsActivity extends AppCompatActivity {
|
||||
@Override
|
||||
public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {
|
||||
idChannel = channelId[position];
|
||||
if( position > 0 ) {
|
||||
if (position > 0) {
|
||||
selectedChannel = myChannels.get(position - 1);
|
||||
}
|
||||
}
|
||||
|
@ -98,12 +98,12 @@ public class MainActivity extends AppCompatActivity {
|
||||
new Thread(() -> {
|
||||
try {
|
||||
Token token = new RetrofitPeertubeAPI(MainActivity.this).manageToken(oauthParams);
|
||||
if( token == null) {
|
||||
if (token == null) {
|
||||
runOnUiThread(() -> Helper.logoutCurrentUser(MainActivity.this, account));
|
||||
return;
|
||||
}
|
||||
UserMe userMe = new RetrofitPeertubeAPI(MainActivity.this, instance, token.getAccess_token()).verifyCredentials();
|
||||
if( userMe != null && userMe.getAccount() != null) {
|
||||
if (userMe != null && userMe.getAccount() != null) {
|
||||
new AccountDAO(MainActivity.this, db).updateAccount(userMe.getAccount());
|
||||
SharedPreferences.Editor editor = sharedpreferences.edit();
|
||||
editor.putString(Helper.PREF_KEY_ID, account.getId());
|
||||
@ -113,7 +113,7 @@ public class MainActivity extends AppCompatActivity {
|
||||
Set<String> videoLanguageServerSet = new TreeSet<>(videoLanguageServer);
|
||||
videoLanguageServerSet.addAll(videoLanguageServer);
|
||||
Set<String> videoLanguageLocal = sharedpreferences.getStringSet(getString(R.string.set_video_language_choice), null);
|
||||
if( videoLanguageServerSet.size() > 0 && videoLanguageLocal != null) {
|
||||
if (videoLanguageServerSet.size() > 0 && videoLanguageLocal != null) {
|
||||
videoLanguageServer.addAll(videoLanguageLocal);
|
||||
}
|
||||
editor.putStringSet(getString(R.string.set_video_language_choice), videoLanguageServerSet);
|
||||
|
@ -86,7 +86,9 @@ import com.google.android.exoplayer2.util.Util;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
|
||||
import app.fedilab.fedilabtube.client.APIResponse;
|
||||
@ -154,7 +156,7 @@ public class PeertubeActivity extends AppCompatActivity implements CommentListAd
|
||||
private List<Caption> captions;
|
||||
private TextView no_action_text;
|
||||
private String max_id;
|
||||
private RecyclerView lv_comments;
|
||||
private RecyclerView lv_comments;
|
||||
private boolean flag_loading;
|
||||
|
||||
private List<Comment> comments;
|
||||
@ -197,7 +199,7 @@ public class PeertubeActivity extends AppCompatActivity implements CommentListAd
|
||||
SQLiteDatabase db = Sqlite.getInstance(getApplicationContext(), Sqlite.DB_NAME, null, Sqlite.DB_VERSION).open();
|
||||
SharedPreferences sharedpreferences = getSharedPreferences(Helper.APP_PREFS, MODE_PRIVATE);
|
||||
String token = sharedpreferences.getString(Helper.PREF_KEY_OAUTH_TOKEN, null);
|
||||
if( Helper.isLoggedIn(PeertubeActivity.this)) {
|
||||
if (Helper.isLoggedIn(PeertubeActivity.this)) {
|
||||
Account account = new AccountDAO(PeertubeActivity.this, db).getAccountByToken(token);
|
||||
Helper.loadGiF(PeertubeActivity.this, account.getAvatar() != null ? account.getAvatar().getPath() : null, my_pp);
|
||||
}
|
||||
@ -255,7 +257,7 @@ public class PeertubeActivity extends AppCompatActivity implements CommentListAd
|
||||
getWindow().setAttributes(attrs);
|
||||
getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_LOW_PROFILE);
|
||||
peertube_information_container.setVisibility(View.GONE);
|
||||
setRequestedOrientation (ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE);
|
||||
setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE);
|
||||
} else {
|
||||
WindowManager.LayoutParams attrs = getWindow().getAttributes();
|
||||
attrs.flags &= ~WindowManager.LayoutParams.FLAG_FULLSCREEN;
|
||||
@ -303,7 +305,7 @@ public class PeertubeActivity extends AppCompatActivity implements CommentListAd
|
||||
if (firstVisibleItem + visibleItemCount == totalItemCount) {
|
||||
if (!flag_loading) {
|
||||
CommentVM commentViewModel = new ViewModelProvider(PeertubeActivity.this).get(CommentVM.class);
|
||||
commentViewModel.getThread(videoId, max_id).observe(PeertubeActivity.this, apiresponse ->manageVIewComment(apiresponse));
|
||||
commentViewModel.getThread(videoId, max_id).observe(PeertubeActivity.this, apiresponse -> manageVIewComment(apiresponse));
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -363,11 +365,6 @@ public class PeertubeActivity extends AppCompatActivity implements CommentListAd
|
||||
|
||||
peertube_playlist.setVisibility(View.VISIBLE);
|
||||
peertube_bookmark.setVisibility(View.GONE);
|
||||
List<String> videoIds = new ArrayList<>();
|
||||
videoIds.add(videoId);
|
||||
if (Helper.isLoggedIn(PeertubeActivity.this)) {
|
||||
playlistsViewModel.videoExists(videoIds).observe(PeertubeActivity.this, this::manageVIewVideosExist);
|
||||
}
|
||||
TimelineVM feedsViewModel = new ViewModelProvider(PeertubeActivity.this).get(TimelineVM.class);
|
||||
feedsViewModel.getVideo(videoId).observe(PeertubeActivity.this, this::manageVIewVideo);
|
||||
CaptionsVM captionsViewModel = new ViewModelProvider(PeertubeActivity.this).get(CaptionsVM.class);
|
||||
@ -513,7 +510,6 @@ public class PeertubeActivity extends AppCompatActivity implements CommentListAd
|
||||
peertube = apiResponse.getPeertubes().get(0);
|
||||
|
||||
|
||||
|
||||
add_comment_read.setOnClickListener(v -> {
|
||||
if (isLoggedIn(PeertubeActivity.this)) {
|
||||
add_comment_read.setVisibility(View.GONE);
|
||||
@ -545,7 +541,7 @@ public class PeertubeActivity extends AppCompatActivity implements CommentListAd
|
||||
|
||||
|
||||
peertube_playlist.setOnClickListener(v -> {
|
||||
if (playlists != null && peertube.getId() != null) {
|
||||
if (playlists != null && videoId != null) {
|
||||
PopupMenu popup = new PopupMenu(PeertubeActivity.this, peertube_playlist);
|
||||
|
||||
for (Playlist playlist : playlists) {
|
||||
@ -586,7 +582,7 @@ public class PeertubeActivity extends AppCompatActivity implements CommentListAd
|
||||
playlistForVideo.remove(playlist.getId());
|
||||
} else {
|
||||
item1.setTitle("✔ " + playlist.getDisplayName());
|
||||
playlistsViewModel.manage(PlaylistsVM.action.ADD_VIDEOS, playlist, peertube.getId()).observe(PeertubeActivity.this, apiResponse3 -> manageVIewPlaylists(PlaylistsVM.action.ADD_VIDEOS, apiResponse3));
|
||||
playlistsViewModel.manage(PlaylistsVM.action.ADD_VIDEOS, playlist, videoId).observe(PeertubeActivity.this, apiResponse3 -> manageVIewPlaylists(PlaylistsVM.action.ADD_VIDEOS, apiResponse3));
|
||||
playlistForVideo.add(playlist.getId());
|
||||
}
|
||||
return false;
|
||||
@ -846,7 +842,6 @@ public class PeertubeActivity extends AppCompatActivity implements CommentListAd
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public void onDestroy() {
|
||||
super.onDestroy();
|
||||
@ -931,7 +926,7 @@ public class PeertubeActivity extends AppCompatActivity implements CommentListAd
|
||||
final ArrayAdapter<String> arrayAdapter = new ArrayAdapter<>(PeertubeActivity.this, android.R.layout.select_dialog_item);
|
||||
for (File file : peertube.getFiles()) {
|
||||
if (file.getResolutions() != null) {
|
||||
if( file.getResolutions().getLabel().compareTo("0p") != 0) {
|
||||
if (file.getResolutions().getLabel().compareTo("0p") != 0) {
|
||||
arrayAdapter.add(file.getResolutions().getLabel());
|
||||
}
|
||||
}
|
||||
@ -1026,10 +1021,10 @@ public class PeertubeActivity extends AppCompatActivity implements CommentListAd
|
||||
fullScreenButton.setOnClickListener(v -> {
|
||||
if (!fullScreenMode) {
|
||||
openFullscreenDialog();
|
||||
setRequestedOrientation (ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE);
|
||||
}else {
|
||||
setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE);
|
||||
} else {
|
||||
closeFullscreenDialog();
|
||||
setRequestedOrientation (ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);
|
||||
setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);
|
||||
Handler handler = new Handler();
|
||||
handler.postDelayed(() -> setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_SENSOR), 2000);
|
||||
|
||||
@ -1074,19 +1069,23 @@ public class PeertubeActivity extends AppCompatActivity implements CommentListAd
|
||||
}
|
||||
|
||||
public void manageVIewPlaylists(PlaylistsVM.action actionType, APIResponse apiResponse) {
|
||||
|
||||
if (actionType == GET_PLAYLISTS && apiResponse != null) {
|
||||
playlists = apiResponse.getPlaylists();
|
||||
playlistsViewModel.videoExists(videoId).observe(PeertubeActivity.this, this::manageVIewVideosExist);
|
||||
}
|
||||
}
|
||||
|
||||
public void manageVIewVideosExist(APIResponse apiResponse) {
|
||||
playlistForVideo = new ArrayList<>();
|
||||
if( apiResponse.getError() == null && apiResponse.getVideoExistPlaylist() != null) {
|
||||
|
||||
List<PlaylistExist.VideoId> videoIds = apiResponse.getVideoExistPlaylist();
|
||||
for(PlaylistExist.VideoId videoId: videoIds) {
|
||||
playlistForVideo.add(videoId.getPlaylistId());
|
||||
if (apiResponse.getError() == null && apiResponse.getVideoExistPlaylist() != null) {
|
||||
Map<String, List<PlaylistExist>> videoIds = apiResponse.getVideoExistPlaylist();
|
||||
Iterator<Map.Entry<String, List<PlaylistExist>>> it = videoIds.entrySet().iterator();
|
||||
while (it.hasNext()) {
|
||||
Map.Entry<String, List<PlaylistExist>> pair = it.next();
|
||||
List<PlaylistExist> playlistExistVideo = pair.getValue();
|
||||
for (PlaylistExist playlistExist : playlistExistVideo) {
|
||||
playlistForVideo.add(playlistExist.getPlaylistId());
|
||||
}
|
||||
it.remove();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -671,7 +671,7 @@ public class PeertubeEditUploadActivity extends AppCompatActivity {
|
||||
set_upload_submit.setEnabled(true);
|
||||
}
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
@SuppressWarnings({"unused", "RedundantSuppression"})
|
||||
public void manageVIewPostActions(RetrofitPeertubeAPI.ActionType statusAction, APIResponse apiResponse) {
|
||||
Intent intent = new Intent(PeertubeEditUploadActivity.this, MainActivity.class);
|
||||
intent.putExtra(Helper.INTENT_ACTION, Helper.RELOAD_MYVIDEOS);
|
||||
|
@ -29,7 +29,7 @@ import app.fedilab.fedilabtube.client.data.VideoData;
|
||||
import app.fedilab.fedilabtube.client.data.VideoPlaylistData.VideoPlaylist;
|
||||
import app.fedilab.fedilabtube.client.entities.Error;
|
||||
import app.fedilab.fedilabtube.client.entities.OverviewVideo;
|
||||
import app.fedilab.fedilabtube.client.entities.PlaylistExist.VideoId;
|
||||
import app.fedilab.fedilabtube.client.entities.PlaylistExist;
|
||||
import app.fedilab.fedilabtube.client.entities.Rating;
|
||||
|
||||
@SuppressWarnings({"unused", "RedundantSuppression"})
|
||||
@ -41,7 +41,7 @@ public class APIResponse {
|
||||
private String actionReturn = null;
|
||||
private Rating rating;
|
||||
private OverviewVideo overviewVideo = null;
|
||||
private List<VideoId> videoExistPlaylist = null;
|
||||
private Map<String, List<PlaylistExist>> videoExistPlaylist = null;
|
||||
private List<VideoData.Video> peertubes = null;
|
||||
private List<CommentData.Comment> comments = null;
|
||||
private List<Block> muted;
|
||||
@ -240,11 +240,11 @@ public class APIResponse {
|
||||
this.videoPlaylist = videoPlaylist;
|
||||
}
|
||||
|
||||
public List<VideoId> getVideoExistPlaylist() {
|
||||
public Map<String, List<PlaylistExist>> getVideoExistPlaylist() {
|
||||
return videoExistPlaylist;
|
||||
}
|
||||
|
||||
public void setVideoExistPlaylist(List<VideoId> videoExistPlaylist) {
|
||||
public void setVideoExistPlaylist(Map<String, List<PlaylistExist>> videoExistPlaylist) {
|
||||
this.videoExistPlaylist = videoExistPlaylist;
|
||||
}
|
||||
}
|
||||
|
@ -55,7 +55,7 @@ import retrofit2.http.Path;
|
||||
import retrofit2.http.Query;
|
||||
import retrofit2.http.QueryMap;
|
||||
|
||||
|
||||
@SuppressWarnings({"unused", "RedundantSuppression"})
|
||||
public interface PeertubeService {
|
||||
@GET("instances")
|
||||
Call<InstanceData> getInstances(@QueryMap Map<String, String> params, @Query("nsfwPolicy[]") String nsfwPolicy, @Query("categoriesOr[]") List<Integer> categories, @Query("languagesOr[]") List<String> languages);
|
||||
@ -238,7 +238,7 @@ public interface PeertubeService {
|
||||
Call<VideoPlaylistData> getVideosPlayList(@Header("Authorization") String credentials, @Path("id") String id);
|
||||
|
||||
@GET("users/me/video-playlists/videos-exist")
|
||||
Call<PlaylistExist> getVideoExistsInPlaylist(@Header("Authorization") String credentials, @Query("videoIds") List<String> videoIds);
|
||||
Call<Map<String, List<PlaylistExist>>> getVideoExistsInPlaylist(@Header("Authorization") String credentials, @Query("videoIds") String videoIds);
|
||||
|
||||
@Multipart
|
||||
@POST("video-playlists")
|
||||
@ -264,7 +264,7 @@ public interface PeertubeService {
|
||||
|
||||
@FormUrlEncoded
|
||||
@POST("video-playlists/{id}/videos")
|
||||
Call<String> addVideoInPlaylist(@Header("Authorization") String credentials, @Path("id") String id, @Field("videoId") String videoId);
|
||||
Call<VideoPlaylistData.PlaylistElement> addVideoInPlaylist(@Header("Authorization") String credentials, @Path("id") String id, @Field("videoId") String videoId);
|
||||
|
||||
|
||||
@DELETE("video-playlists/{id}")
|
||||
|
@ -79,6 +79,7 @@ import retrofit2.Response;
|
||||
import retrofit2.Retrofit;
|
||||
import retrofit2.converter.gson.GsonConverterFactory;
|
||||
|
||||
@SuppressWarnings({"unused", "RedundantSuppression"})
|
||||
public class RetrofitPeertubeAPI {
|
||||
|
||||
private String finalUrl;
|
||||
@ -1081,14 +1082,14 @@ public class RetrofitPeertubeAPI {
|
||||
* @param videoIds List<String> ids of videos
|
||||
* @return APIResponse
|
||||
*/
|
||||
public APIResponse getVideosExist(List<String> videoIds) {
|
||||
public APIResponse getVideosExist(String videoIds) {
|
||||
PeertubeService peertubeService = init();
|
||||
APIResponse apiResponse = new APIResponse();
|
||||
try {
|
||||
Call<PlaylistExist> videoExistsInPlaylist = peertubeService.getVideoExistsInPlaylist(getToken(), videoIds);
|
||||
Response<PlaylistExist> response = videoExistsInPlaylist.execute();
|
||||
Call<Map<String, List<PlaylistExist>>> videoExistsInPlaylist = peertubeService.getVideoExistsInPlaylist(getToken(), videoIds);
|
||||
Response<Map<String, List<PlaylistExist>>> response = videoExistsInPlaylist.execute();
|
||||
if (response.isSuccessful() && response.body() != null) {
|
||||
apiResponse.setVideoExistPlaylist(response.body().getVideoId());
|
||||
apiResponse.setVideoExistPlaylist(response.body());
|
||||
} else {
|
||||
setError(apiResponse, response.code(), response.errorBody());
|
||||
}
|
||||
@ -1132,7 +1133,7 @@ public class RetrofitPeertubeAPI {
|
||||
} else {
|
||||
setError(apiResponse, response.code(), response.errorBody());
|
||||
}
|
||||
} else if (type == PlaylistsVM.action.GET_LIST_VIDEOS) {
|
||||
} else if (type == PlaylistsVM.action.GET_LIST_VIDEOS) {
|
||||
Call<VideoPlaylistData> videosPlayList = peertubeService.getVideosPlayList(getToken(), playlistId);
|
||||
Response<VideoPlaylistData> response = videosPlayList.execute();
|
||||
if (response.isSuccessful() && response.body() != null) {
|
||||
@ -1149,10 +1150,10 @@ public class RetrofitPeertubeAPI {
|
||||
setError(apiResponse, response.code(), response.errorBody());
|
||||
}
|
||||
} else if (type == PlaylistsVM.action.ADD_VIDEOS) {
|
||||
Call<String> stringCall = peertubeService.addVideoInPlaylist(getToken(), playlistId, videoId);
|
||||
Response<String> response = stringCall.execute();
|
||||
if (response.isSuccessful()) {
|
||||
apiResponse.setActionReturn(response.body());
|
||||
Call<VideoPlaylistData.PlaylistElement> stringCall = peertubeService.addVideoInPlaylist(getToken(), playlistId, videoId);
|
||||
Response<VideoPlaylistData.PlaylistElement> response = stringCall.execute();
|
||||
if (response.isSuccessful() && response.body() != null) {
|
||||
apiResponse.setActionReturn(response.body().getVideoPlaylistElement().getId());
|
||||
} else {
|
||||
setError(apiResponse, response.code(), response.errorBody());
|
||||
}
|
||||
|
@ -25,7 +25,7 @@ import java.util.List;
|
||||
import app.fedilab.fedilabtube.client.entities.Avatar;
|
||||
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
@SuppressWarnings({"unused", "RedundantSuppression"})
|
||||
public class AccountData {
|
||||
|
||||
@SerializedName("total")
|
||||
|
@ -19,6 +19,7 @@ import com.google.gson.annotations.SerializedName;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
@SuppressWarnings({"unused", "RedundantSuppression"})
|
||||
public class BlockData {
|
||||
|
||||
@SerializedName("total")
|
||||
|
@ -20,7 +20,7 @@ import java.util.List;
|
||||
|
||||
import app.fedilab.fedilabtube.client.entities.ItemStr;
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
@SuppressWarnings({"unused", "RedundantSuppression"})
|
||||
public class CaptionData {
|
||||
|
||||
@SerializedName("total")
|
||||
|
@ -27,7 +27,7 @@ import app.fedilab.fedilabtube.client.entities.Avatar;
|
||||
import app.fedilab.fedilabtube.client.entities.ItemStr;
|
||||
import app.fedilab.fedilabtube.client.entities.ViewsPerDay;
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
@SuppressWarnings({"unused", "RedundantSuppression"})
|
||||
public class ChannelData {
|
||||
|
||||
@SerializedName("total")
|
||||
|
@ -19,7 +19,7 @@ import com.google.gson.annotations.SerializedName;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
@SuppressWarnings({"unused", "RedundantSuppression"})
|
||||
public class CommentData {
|
||||
|
||||
@SerializedName("total")
|
||||
|
@ -7,7 +7,7 @@ import com.google.gson.annotations.SerializedName;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
@SuppressWarnings({"unused", "RedundantSuppression"})
|
||||
public class InstanceData {
|
||||
|
||||
@SerializedName("total")
|
||||
|
@ -23,7 +23,7 @@ import app.fedilab.fedilabtube.client.entities.VideoBlacklist;
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along with TubeLab; if not,
|
||||
* see <http://www.gnu.org/licenses>. */
|
||||
@SuppressWarnings("unused")
|
||||
@SuppressWarnings({"unused", "RedundantSuppression"})
|
||||
public class NotificationData {
|
||||
|
||||
@SerializedName("total")
|
||||
|
@ -24,7 +24,7 @@ import java.util.List;
|
||||
|
||||
import app.fedilab.fedilabtube.client.entities.Item;
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
@SuppressWarnings({"unused", "RedundantSuppression"})
|
||||
public class PlaylistData {
|
||||
|
||||
@SerializedName("total")
|
||||
|
@ -34,7 +34,7 @@ import app.fedilab.fedilabtube.client.entities.StreamingPlaylists;
|
||||
import app.fedilab.fedilabtube.helper.Helper;
|
||||
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
@SuppressWarnings({"unused", "RedundantSuppression"})
|
||||
public class VideoData {
|
||||
|
||||
@SerializedName("total")
|
||||
|
@ -20,7 +20,7 @@ import com.google.gson.annotations.SerializedName;
|
||||
import java.util.List;
|
||||
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
@SuppressWarnings({"unused", "RedundantSuppression"})
|
||||
public class VideoPlaylistData {
|
||||
|
||||
@SerializedName("total")
|
||||
@ -120,6 +120,19 @@ public class VideoPlaylistData {
|
||||
}
|
||||
}
|
||||
|
||||
public static class PlaylistElement {
|
||||
@SerializedName("videoPlaylistElement")
|
||||
private VideoPlaylistCreationItem videoPlaylistElement;
|
||||
|
||||
public VideoPlaylistCreationItem getVideoPlaylistElement() {
|
||||
return videoPlaylistElement;
|
||||
}
|
||||
|
||||
public void setVideoPlaylistElement(VideoPlaylistCreationItem videoPlaylistElement) {
|
||||
this.videoPlaylistElement = videoPlaylistElement;
|
||||
}
|
||||
}
|
||||
|
||||
public static class VideoPlaylistCreationItem {
|
||||
@SerializedName("id")
|
||||
String id;
|
||||
|
@ -14,7 +14,7 @@ package app.fedilab.fedilabtube.client.entities;
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along with TubeLab; if not,
|
||||
* see <http://www.gnu.org/licenses>. */
|
||||
@SuppressWarnings("unused")
|
||||
@SuppressWarnings({"unused", "RedundantSuppression"})
|
||||
public class AccountCreation {
|
||||
|
||||
private String username;
|
||||
|
@ -16,6 +16,7 @@ package app.fedilab.fedilabtube.client.entities;
|
||||
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
|
||||
@SuppressWarnings({"unused", "RedundantSuppression"})
|
||||
public class Actor {
|
||||
@SerializedName("type")
|
||||
private String type;
|
||||
|
@ -16,7 +16,7 @@ package app.fedilab.fedilabtube.client.entities;
|
||||
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
@SuppressWarnings({"unused", "RedundantSuppression"})
|
||||
public class ActorFollow {
|
||||
|
||||
@SerializedName("id")
|
||||
|
@ -21,7 +21,7 @@ import java.util.Date;
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along with TubeLab; if not,
|
||||
* see <http://www.gnu.org/licenses>. */
|
||||
@SuppressWarnings("unused")
|
||||
@SuppressWarnings({"unused", "RedundantSuppression"})
|
||||
public class Avatar implements Parcelable {
|
||||
|
||||
|
||||
|
@ -16,7 +16,7 @@ package app.fedilab.fedilabtube.client.entities;
|
||||
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
@SuppressWarnings({"unused", "RedundantSuppression"})
|
||||
public class CaptionsParams {
|
||||
|
||||
@SerializedName("captionLanguage")
|
||||
|
@ -16,7 +16,7 @@ package app.fedilab.fedilabtube.client.entities;
|
||||
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
@SuppressWarnings({"unused", "RedundantSuppression"})
|
||||
public class ChannelParams {
|
||||
|
||||
@SerializedName("displayName")
|
||||
|
@ -22,6 +22,7 @@ import android.widget.Toast;
|
||||
import app.fedilab.fedilabtube.R;
|
||||
import es.dmoral.toasty.Toasty;
|
||||
|
||||
@SuppressWarnings({"unused", "RedundantSuppression"})
|
||||
public class Error extends Throwable {
|
||||
|
||||
private String error = null;
|
||||
|
@ -3,7 +3,7 @@ package app.fedilab.fedilabtube.client.entities;
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
@SuppressWarnings({"unused", "RedundantSuppression"})
|
||||
public class File {
|
||||
|
||||
@SerializedName("fileDownloadUrl")
|
||||
|
@ -16,6 +16,7 @@ package app.fedilab.fedilabtube.client.entities;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@SuppressWarnings({"unused", "RedundantSuppression"})
|
||||
public class InstanceParams {
|
||||
|
||||
private boolean healthy = true;
|
||||
|
@ -19,6 +19,7 @@ import android.os.Parcelable;
|
||||
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
|
||||
@SuppressWarnings({"unused", "RedundantSuppression"})
|
||||
public class Item implements Parcelable {
|
||||
|
||||
public static final Parcelable.Creator<Item> CREATOR = new Parcelable.Creator<Item>() {
|
||||
|
@ -19,7 +19,7 @@ import android.os.Parcelable;
|
||||
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
@SuppressWarnings({"unused", "RedundantSuppression"})
|
||||
public class ItemStr implements Parcelable {
|
||||
|
||||
public static final Creator<ItemStr> CREATOR = new Creator<ItemStr>() {
|
||||
|
@ -16,6 +16,7 @@ package app.fedilab.fedilabtube.client.entities;
|
||||
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
|
||||
@SuppressWarnings({"unused", "RedundantSuppression"})
|
||||
public class NotificationSettings {
|
||||
|
||||
@SerializedName("abuseAsModerator")
|
||||
|
@ -16,6 +16,7 @@ package app.fedilab.fedilabtube.client.entities;
|
||||
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
|
||||
@SuppressWarnings({"unused", "RedundantSuppression"})
|
||||
public class Oauth {
|
||||
|
||||
@SerializedName("client_id")
|
||||
|
@ -16,6 +16,7 @@ package app.fedilab.fedilabtube.client.entities;
|
||||
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
|
||||
@SuppressWarnings({"unused", "RedundantSuppression"})
|
||||
public class OauthParams {
|
||||
|
||||
|
||||
|
@ -21,7 +21,7 @@ import java.util.List;
|
||||
import app.fedilab.fedilabtube.client.data.ChannelData.Channel;
|
||||
import app.fedilab.fedilabtube.client.data.VideoData.Video;
|
||||
|
||||
@SuppressWarnings({"unused"})
|
||||
@SuppressWarnings({"unused", "RedundantSuppression"})
|
||||
public class OverviewVideo {
|
||||
|
||||
@SerializedName("categories")
|
||||
|
@ -16,7 +16,7 @@ package app.fedilab.fedilabtube.client.entities;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
|
||||
@SuppressWarnings({"unused", "RedundantSuppression"})
|
||||
public class PeertubeInformation {
|
||||
|
||||
private Map<Integer, String> categories;
|
||||
|
@ -16,61 +16,48 @@ package app.fedilab.fedilabtube.client.entities;
|
||||
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@SuppressWarnings({"unused", "RedundantSuppression"})
|
||||
public class PlaylistExist {
|
||||
|
||||
@SerializedName("videoId")
|
||||
private List<VideoId> videoId;
|
||||
@SerializedName("playlistElementId")
|
||||
private String playlistElementId;
|
||||
@SerializedName("playlistId")
|
||||
private String playlistId;
|
||||
@SerializedName("startTimestamp")
|
||||
private long startTimestamp;
|
||||
@SerializedName("stopTimestamp")
|
||||
private long stopTimestamp;
|
||||
|
||||
public List<VideoId> getVideoId() {
|
||||
return videoId;
|
||||
public String getPlaylistElementId() {
|
||||
return playlistElementId;
|
||||
}
|
||||
|
||||
public void setVideoId(List<VideoId> videoId) {
|
||||
this.videoId = videoId;
|
||||
public void setPlaylistElementId(String playlistElementId) {
|
||||
this.playlistElementId = playlistElementId;
|
||||
}
|
||||
|
||||
public static class VideoId {
|
||||
@SerializedName("playlistElementId")
|
||||
private String playlistElementId;
|
||||
@SerializedName("playlistId")
|
||||
private String playlistId;
|
||||
@SerializedName("startTimestamp")
|
||||
private long startTimestamp;
|
||||
@SerializedName("stopTimestamp")
|
||||
private long stopTimestamp;
|
||||
public String getPlaylistId() {
|
||||
return playlistId;
|
||||
}
|
||||
|
||||
public String getPlaylistElementId() {
|
||||
return playlistElementId;
|
||||
}
|
||||
public void setPlaylistId(String playlistId) {
|
||||
this.playlistId = playlistId;
|
||||
}
|
||||
|
||||
public void setPlaylistElementId(String playlistElementId) {
|
||||
this.playlistElementId = playlistElementId;
|
||||
}
|
||||
public long getStartTimestamp() {
|
||||
return startTimestamp;
|
||||
}
|
||||
|
||||
public String getPlaylistId() {
|
||||
return playlistId;
|
||||
}
|
||||
public void setStartTimestamp(long startTimestamp) {
|
||||
this.startTimestamp = startTimestamp;
|
||||
}
|
||||
|
||||
public void setPlaylistId(String playlistId) {
|
||||
this.playlistId = playlistId;
|
||||
}
|
||||
public long getStopTimestamp() {
|
||||
return stopTimestamp;
|
||||
}
|
||||
|
||||
public long getStartTimestamp() {
|
||||
return startTimestamp;
|
||||
}
|
||||
|
||||
public void setStartTimestamp(long startTimestamp) {
|
||||
this.startTimestamp = startTimestamp;
|
||||
}
|
||||
|
||||
public long getStopTimestamp() {
|
||||
return stopTimestamp;
|
||||
}
|
||||
|
||||
public void setStopTimestamp(long stopTimestamp) {
|
||||
this.stopTimestamp = stopTimestamp;
|
||||
}
|
||||
public void setStopTimestamp(long stopTimestamp) {
|
||||
this.stopTimestamp = stopTimestamp;
|
||||
}
|
||||
}
|
||||
|
@ -17,6 +17,7 @@ package app.fedilab.fedilabtube.client.entities;
|
||||
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
|
||||
@SuppressWarnings({"unused", "RedundantSuppression"})
|
||||
public class PlaylistParams {
|
||||
|
||||
@SerializedName("displayName")
|
||||
|
@ -16,7 +16,7 @@ package app.fedilab.fedilabtube.client.entities;
|
||||
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
@SuppressWarnings({"unused", "RedundantSuppression"})
|
||||
public class Rating {
|
||||
|
||||
@SerializedName("videoId")
|
||||
|
@ -18,7 +18,7 @@ import java.util.List;
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along with TubeLab; if not,
|
||||
* see <http://www.gnu.org/licenses>. */
|
||||
@SuppressWarnings("unused")
|
||||
@SuppressWarnings({"unused", "RedundantSuppression"})
|
||||
public class Report {
|
||||
|
||||
@SerializedName("reason")
|
||||
|
@ -18,7 +18,7 @@ import com.google.gson.annotations.SerializedName;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
@SuppressWarnings({"unused", "RedundantSuppression"})
|
||||
public class StreamingPlaylists {
|
||||
|
||||
@SerializedName("id")
|
||||
|
@ -16,6 +16,7 @@ package app.fedilab.fedilabtube.client.entities;
|
||||
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
|
||||
@SuppressWarnings({"unused", "RedundantSuppression"})
|
||||
public class Token {
|
||||
|
||||
@SerializedName("access_token")
|
||||
|
@ -22,6 +22,7 @@ import java.util.List;
|
||||
import app.fedilab.fedilabtube.client.data.AccountData.Account;
|
||||
import app.fedilab.fedilabtube.client.data.ChannelData;
|
||||
|
||||
@SuppressWarnings({"unused", "RedundantSuppression"})
|
||||
public class UserMe {
|
||||
|
||||
@SerializedName("account")
|
||||
|
@ -18,6 +18,7 @@ import com.google.gson.annotations.SerializedName;
|
||||
|
||||
import app.fedilab.fedilabtube.client.data.VideoData;
|
||||
|
||||
@SuppressWarnings({"unused", "RedundantSuppression"})
|
||||
public class VideoAbuse {
|
||||
|
||||
@SerializedName("id")
|
||||
|
@ -18,6 +18,7 @@ import com.google.gson.annotations.SerializedName;
|
||||
|
||||
import app.fedilab.fedilabtube.client.data.VideoData;
|
||||
|
||||
@SuppressWarnings({"unused", "RedundantSuppression"})
|
||||
public class VideoBlacklist {
|
||||
|
||||
@SerializedName("id")
|
||||
|
@ -21,7 +21,7 @@ import org.jetbrains.annotations.NotNull;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
@SuppressWarnings({"unused", "RedundantSuppression"})
|
||||
public class VideoParams {
|
||||
|
||||
@SerializedName("channelId")
|
||||
|
@ -18,6 +18,7 @@ import com.google.gson.annotations.SerializedName;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
@SuppressWarnings({"unused", "RedundantSuppression"})
|
||||
public class ViewsPerDay {
|
||||
|
||||
@SerializedName("date")
|
||||
|
@ -17,7 +17,7 @@ package app.fedilab.fedilabtube.client.entities;
|
||||
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
@SuppressWarnings({"unused", "RedundantSuppression"})
|
||||
public class WellKnownNodeinfo {
|
||||
@SerializedName("reel")
|
||||
private String reel;
|
||||
|
@ -14,29 +14,18 @@ package app.fedilab.fedilabtube.drawer;
|
||||
* You should have received a copy of the GNU General Public License along with TubeLab; if not,
|
||||
* see <http://www.gnu.org/licenses>. */
|
||||
|
||||
import android.app.Activity;
|
||||
import android.app.AlertDialog;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.content.SharedPreferences;
|
||||
import android.os.Bundle;
|
||||
import android.os.Handler;
|
||||
import android.os.Looper;
|
||||
import android.util.Log;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.EditText;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.LinearLayout;
|
||||
import android.widget.TextView;
|
||||
import android.widget.Toast;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.appcompat.widget.PopupMenu;
|
||||
import androidx.lifecycle.LifecycleOwner;
|
||||
import androidx.lifecycle.ViewModelProvider;
|
||||
import androidx.lifecycle.ViewModelStoreOwner;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import java.util.List;
|
||||
@ -45,38 +34,24 @@ import app.fedilab.fedilabtube.PeertubeActivity;
|
||||
import app.fedilab.fedilabtube.PeertubeEditUploadActivity;
|
||||
import app.fedilab.fedilabtube.R;
|
||||
import app.fedilab.fedilabtube.ShowChannelActivity;
|
||||
import app.fedilab.fedilabtube.client.APIResponse;
|
||||
import app.fedilab.fedilabtube.client.RetrofitPeertubeAPI;
|
||||
import app.fedilab.fedilabtube.client.data.PlaylistData;
|
||||
import app.fedilab.fedilabtube.client.data.VideoData;
|
||||
import app.fedilab.fedilabtube.client.entities.Report;
|
||||
import app.fedilab.fedilabtube.helper.Helper;
|
||||
import app.fedilab.fedilabtube.viewmodel.PlaylistsVM;
|
||||
import app.fedilab.fedilabtube.viewmodel.PostActionsVM;
|
||||
import app.fedilab.fedilabtube.viewmodel.TimelineVM;
|
||||
import es.dmoral.toasty.Toasty;
|
||||
|
||||
|
||||
public class PeertubeAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> {
|
||||
|
||||
private List<VideoData.Video> videos;
|
||||
private Context context;
|
||||
TimelineVM.TimelineType timelineType;
|
||||
PlaylistData.Playlist playlist;
|
||||
private boolean myVideos;
|
||||
|
||||
public PeertubeAdapter(List<VideoData.Video> videos, TimelineVM.TimelineType timelineType) {
|
||||
public PeertubeAdapter(List<VideoData.Video> videos, boolean myVideos) {
|
||||
this.videos = videos;
|
||||
this.timelineType = timelineType;
|
||||
}
|
||||
|
||||
public PeertubeAdapter(List<VideoData.Video> videos, PlaylistData.Playlist playlist) {
|
||||
this.videos = videos;
|
||||
this.timelineType = TimelineVM.TimelineType.VIDEOS_IN_PLAYLIST;
|
||||
this.playlist = playlist;
|
||||
this.myVideos = myVideos;
|
||||
}
|
||||
|
||||
public PeertubeAdapter(List<VideoData.Video> videos) {
|
||||
this.videos = videos;
|
||||
this.myVideos = false;
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@ -87,12 +62,6 @@ public class PeertubeAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolde
|
||||
return new ViewHolder(layoutInflater.inflate(R.layout.drawer_peertube, parent, false));
|
||||
}
|
||||
|
||||
public PeertubeAdapter.AllVideoRemoved allVideoRemoved;
|
||||
|
||||
public interface AllVideoRemoved {
|
||||
void onAllVideoRemoved();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBindViewHolder(@NonNull RecyclerView.ViewHolder viewHolder, int position) {
|
||||
|
||||
@ -108,7 +77,7 @@ public class PeertubeAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolde
|
||||
|
||||
|
||||
boolean ownVideos;
|
||||
if (timelineType != null && timelineType == TimelineVM.TimelineType.MY_VIDEOS) {
|
||||
if (myVideos) {
|
||||
ownVideos = true;
|
||||
} else {
|
||||
ownVideos = video.getAccount() != null && video.getAccount().getId() != null && video.getAccount().getHost().compareTo(Helper.getLiveInstance(context)) == 0 && video.getAccount().getId().compareTo(userId) == 0;
|
||||
@ -151,100 +120,31 @@ public class PeertubeAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolde
|
||||
}
|
||||
|
||||
|
||||
holder.bottom_container.setOnClickListener(v -> {
|
||||
Intent intent = new Intent(context, PeertubeActivity.class);
|
||||
Bundle b = new Bundle();
|
||||
b.putString("video_id", video.getUuid());
|
||||
intent.putExtras(b);
|
||||
context.startActivity(intent);
|
||||
});
|
||||
if (!ownVideos) {
|
||||
holder.bottom_container.setOnClickListener(v -> {
|
||||
Intent intent = new Intent(context, PeertubeActivity.class);
|
||||
Bundle b = new Bundle();
|
||||
b.putString("video_id", video.getId());
|
||||
intent.putExtras(b);
|
||||
context.startActivity(intent);
|
||||
});
|
||||
} else {
|
||||
holder.bottom_container.setOnClickListener(v -> {
|
||||
Intent intent = new Intent(context, PeertubeEditUploadActivity.class);
|
||||
Bundle b = new Bundle();
|
||||
b.putString("video_id", video.getUuid());
|
||||
intent.putExtras(b);
|
||||
context.startActivity(intent);
|
||||
});
|
||||
}
|
||||
holder.peertube_video_image.setOnClickListener(v -> {
|
||||
Intent intent = new Intent(context, PeertubeActivity.class);
|
||||
Bundle b = new Bundle();
|
||||
b.putString("video_id", video.getUuid());
|
||||
b.putString("video_id", video.getId());
|
||||
intent.putExtras(b);
|
||||
context.startActivity(intent);
|
||||
});
|
||||
|
||||
holder.more_actions.setOnClickListener(v -> {
|
||||
PopupMenu popup = new PopupMenu(context, holder.more_actions);
|
||||
popup.getMenuInflater()
|
||||
.inflate(R.menu.video_drawer_menu, popup.getMenu());
|
||||
if (timelineType != TimelineVM.TimelineType.MY_VIDEOS) {
|
||||
popup.getMenu().findItem(R.id.action_edit).setVisible(false);
|
||||
if (timelineType != TimelineVM.TimelineType.VIDEOS_IN_PLAYLIST) {
|
||||
popup.getMenu().findItem(R.id.action_remove_playlist).setVisible(false);
|
||||
}
|
||||
} else {
|
||||
popup.getMenu().findItem(R.id.action_report).setVisible(false);
|
||||
popup.getMenu().findItem(R.id.action_remove_playlist).setVisible(false);
|
||||
}
|
||||
popup.setOnMenuItemClickListener(item -> {
|
||||
switch (item.getItemId()) {
|
||||
case R.id.action_remove_playlist:
|
||||
Log.v(Helper.TAG,"action_remove_playlist");
|
||||
PlaylistsVM playlistsViewModel = new ViewModelProvider((ViewModelStoreOwner) context).get(PlaylistsVM.class);
|
||||
playlistsViewModel.manage(PlaylistsVM.action.DELETE_VIDEOS, playlist, video.getId());
|
||||
Log.v(Helper.TAG,"playlist.getUuid(): " + playlist.getUuid());
|
||||
Log.v(Helper.TAG,"video.getId(): " + video.getId());
|
||||
Handler mainHandler = new Handler(Looper.getMainLooper());
|
||||
Runnable myRunnable = () -> {
|
||||
videos.remove(video);
|
||||
notifyDataSetChanged();
|
||||
if (videos.size() == 0) {
|
||||
allVideoRemoved.onAllVideoRemoved();
|
||||
}
|
||||
};
|
||||
mainHandler.post(myRunnable);
|
||||
break;
|
||||
case R.id.action_edit:
|
||||
Intent intent = new Intent(context, PeertubeEditUploadActivity.class);
|
||||
Bundle b = new Bundle();
|
||||
b.putString("video_id", video.getUuid());
|
||||
intent.putExtras(b);
|
||||
context.startActivity(intent);
|
||||
break;
|
||||
case R.id.action_report:
|
||||
androidx.appcompat.app.AlertDialog.Builder dialogBuilder = new androidx.appcompat.app.AlertDialog.Builder(context);
|
||||
LayoutInflater inflater1 = ((Activity)context).getLayoutInflater();
|
||||
View dialogView = inflater1.inflate(R.layout.popup_report, new LinearLayout(context), false);
|
||||
dialogBuilder.setView(dialogView);
|
||||
EditText report_content = dialogView.findViewById(R.id.report_content);
|
||||
dialogBuilder.setNeutralButton(R.string.cancel, (dialog, id) -> dialog.dismiss());
|
||||
dialogBuilder.setPositiveButton(R.string.report, (dialog, id) -> {
|
||||
if (report_content.getText().toString().trim().length() == 0) {
|
||||
Toasty.info(context, context.getString(R.string.report_comment_size), Toasty.LENGTH_LONG).show();
|
||||
} else {
|
||||
PostActionsVM viewModel = new ViewModelProvider((ViewModelStoreOwner) context).get(PostActionsVM.class);
|
||||
Report report = new Report();
|
||||
Report.VideoReport videoReport = new Report.VideoReport();
|
||||
videoReport.setId(video.getId());
|
||||
report.setVideo(videoReport);
|
||||
report.setReason(report_content.getText().toString());
|
||||
viewModel.report(report).observe((LifecycleOwner) context, apiResponse -> manageVIewPostActions(RetrofitPeertubeAPI.ActionType.REPORT_VIDEO, apiResponse));
|
||||
dialog.dismiss();
|
||||
}
|
||||
});
|
||||
androidx.appcompat.app.AlertDialog alertDialog2 = dialogBuilder.create();
|
||||
alertDialog2.show();
|
||||
break;
|
||||
}
|
||||
return true;
|
||||
});
|
||||
popup.show();
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
public void manageVIewPostActions(RetrofitPeertubeAPI.ActionType statusAction, APIResponse apiResponse) {
|
||||
|
||||
if (apiResponse.getError() != null) {
|
||||
Toasty.error(context, apiResponse.getError().getError(), Toast.LENGTH_LONG).show();
|
||||
return;
|
||||
}
|
||||
if (statusAction == RetrofitPeertubeAPI.ActionType.REPORT_COMMENT) {
|
||||
Toasty.success(context, context.getString(R.string.successful_report_comment), Toasty.LENGTH_LONG).show();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -262,7 +162,7 @@ public class PeertubeAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolde
|
||||
LinearLayout main_container, bottom_container;
|
||||
ImageView peertube_profile, peertube_video_image;
|
||||
TextView peertube_account_name, peertube_views, peertube_duration;
|
||||
TextView peertube_title, peertube_date, header_title, more_actions;
|
||||
TextView peertube_title, peertube_date, header_title;
|
||||
|
||||
public ViewHolder(@NonNull View itemView) {
|
||||
super(itemView);
|
||||
@ -276,7 +176,6 @@ public class PeertubeAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolde
|
||||
main_container = itemView.findViewById(R.id.main_container);
|
||||
header_title = itemView.findViewById(R.id.header_title);
|
||||
bottom_container = itemView.findViewById(R.id.bottom_container);
|
||||
more_actions = itemView.findViewById(R.id.more_actions);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -108,7 +108,7 @@ public class PeertubeNotificationsListAdapter extends RecyclerView.Adapter<Recyc
|
||||
Intent intent = new Intent(context, PeertubeActivity.class);
|
||||
Bundle b = new Bundle();
|
||||
b.putString("peertube_instance", finalAccountAction1.getHost());
|
||||
b.putString("video_id", notification.getComment().getVideo().getUuid());
|
||||
b.putString("video_id", notification.getComment().getVideo().getId());
|
||||
intent.putExtras(b);
|
||||
context.startActivity(intent);
|
||||
});
|
||||
@ -142,11 +142,11 @@ public class PeertubeNotificationsListAdapter extends RecyclerView.Adapter<Recyc
|
||||
Intent intent = new Intent(context, PeertubeActivity.class);
|
||||
Bundle b = new Bundle();
|
||||
b.putString("peertube_instance", Helper.getLiveInstance(context));
|
||||
b.putString("video_id", notification.getVideo().getUuid());
|
||||
b.putString("video_id", notification.getVideo().getId());
|
||||
intent.putExtras(b);
|
||||
context.startActivity(intent);
|
||||
});
|
||||
}else if (notification.getVideoAbuse() != null && notification.getVideoAbuse().getVideo() != null) {
|
||||
} else if (notification.getVideoAbuse() != null && notification.getVideoAbuse().getVideo() != null) {
|
||||
message = context.getString(R.string.peertube_video_abuse, notification.getVideoAbuse().getVideo().getName());
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N)
|
||||
holder.peertube_notif_message.setText(Html.fromHtml(message, Html.FROM_HTML_MODE_LEGACY));
|
||||
|
@ -156,6 +156,7 @@ public class PlaylistAdapter extends BaseAdapter {
|
||||
return convertView;
|
||||
}
|
||||
|
||||
@SuppressWarnings({"unused", "RedundantSuppression"})
|
||||
public void manageVIewPlaylists(PlaylistsVM.action actionType, APIResponse apiResponse) {
|
||||
|
||||
}
|
||||
|
@ -44,6 +44,13 @@ import es.dmoral.toasty.Toasty;
|
||||
|
||||
public class DisplayNotificationsFragment extends Fragment {
|
||||
|
||||
//Peertube notification type
|
||||
public static int NEW_VIDEO_FROM_SUBSCRIPTION = 1;
|
||||
public static int BLACKLIST_ON_MY_VIDEO = 4;
|
||||
public static int UNBLACKLIST_ON_MY_VIDEO = 5;
|
||||
public static int MY_VIDEO_PUBLISHED = 6;
|
||||
public static int MY_VIDEO_IMPORT_SUCCESS = 7;
|
||||
public static int MY_VIDEO_IMPORT_ERROR = 8;
|
||||
private boolean flag_loading;
|
||||
private Context context;
|
||||
private PeertubeNotificationsListAdapter peertubeNotificationsListAdapter;
|
||||
@ -56,16 +63,6 @@ public class DisplayNotificationsFragment extends Fragment {
|
||||
private RecyclerView lv_notifications;
|
||||
private View rootView;
|
||||
|
||||
//Peertube notification type
|
||||
public static int NEW_VIDEO_FROM_SUBSCRIPTION = 1;
|
||||
public static int NEW_REPORT = 3;
|
||||
public static int BLACKLIST_ON_MY_VIDEO = 4;
|
||||
public static int UNBLACKLIST_ON_MY_VIDEO = 5;
|
||||
public static int MY_VIDEO_PUBLISHED = 6;
|
||||
public static int MY_VIDEO_IMPORT_SUCCESS = 7;
|
||||
public static int MY_VIDEO_IMPORT_ERROR = 8;
|
||||
|
||||
|
||||
@Override
|
||||
public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
|
||||
|
||||
|
@ -17,7 +17,6 @@ package app.fedilab.fedilabtube.fragment;
|
||||
import android.app.Activity;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.content.SharedPreferences;
|
||||
import android.os.Bundle;
|
||||
import android.os.Handler;
|
||||
import android.os.Looper;
|
||||
@ -61,12 +60,10 @@ import app.fedilab.fedilabtube.client.data.PlaylistData.Playlist;
|
||||
import app.fedilab.fedilabtube.client.entities.Item;
|
||||
import app.fedilab.fedilabtube.client.entities.PlaylistParams;
|
||||
import app.fedilab.fedilabtube.drawer.PlaylistAdapter;
|
||||
import app.fedilab.fedilabtube.helper.Helper;
|
||||
import app.fedilab.fedilabtube.viewmodel.ChannelsVM;
|
||||
import app.fedilab.fedilabtube.viewmodel.PlaylistsVM;
|
||||
import es.dmoral.toasty.Toasty;
|
||||
|
||||
import static android.content.Context.MODE_PRIVATE;
|
||||
import static app.fedilab.fedilabtube.MainActivity.peertubeInformation;
|
||||
import static app.fedilab.fedilabtube.client.RetrofitPeertubeAPI.DataType.MY_CHANNELS;
|
||||
|
||||
@ -132,8 +129,6 @@ public class DisplayPlaylistsFragment extends Fragment {
|
||||
set_upload_channel = dialogView.findViewById(R.id.set_upload_channel);
|
||||
set_upload_privacy = dialogView.findViewById(R.id.set_upload_privacy);
|
||||
|
||||
final SharedPreferences sharedpreferences = context.getSharedPreferences(Helper.APP_PREFS, MODE_PRIVATE);
|
||||
final String userId = sharedpreferences.getString(Helper.PREF_KEY_ID, null);
|
||||
ChannelsVM viewModelC = new ViewModelProvider(this).get(ChannelsVM.class);
|
||||
viewModelC.get(MY_CHANNELS, null).observe(DisplayPlaylistsFragment.this.requireActivity(), this::manageVIewChannels);
|
||||
|
||||
|
@ -109,8 +109,8 @@ public class SettingsFragment extends PreferenceFragmentCompat implements Shared
|
||||
SeekBarPreference set_video_cache_choice = findPreference(getString(R.string.set_video_cache_choice));
|
||||
assert set_video_cache_choice != null;
|
||||
final int progress = set_video_cache_choice.getValue();
|
||||
set_video_cache_choice.setSummary(getActivity().getString(R.string.video_cache_value, progress*10));
|
||||
editor.putInt(Helper.SET_VIDEO_CACHE, progress*10);
|
||||
set_video_cache_choice.setSummary(getActivity().getString(R.string.video_cache_value, progress * 10));
|
||||
editor.putInt(Helper.SET_VIDEO_CACHE, progress * 10);
|
||||
}
|
||||
if (key.compareTo(getString(R.string.set_video_minimize_choice)) == 0) {
|
||||
SwitchPreference set_video_minimize_choice = findPreference(getString(R.string.set_video_minimize_choice));
|
||||
@ -171,7 +171,7 @@ public class SettingsFragment extends PreferenceFragmentCompat implements Shared
|
||||
SeekBarPreference set_video_cache_choice = findPreference(getString(R.string.set_video_cache_choice));
|
||||
int video_cache = sharedpref.getInt(Helper.SET_VIDEO_CACHE, Helper.DEFAULT_VIDEO_CACHE_MB);
|
||||
assert set_video_cache_choice != null;
|
||||
set_video_cache_choice.setValue(video_cache/10);
|
||||
set_video_cache_choice.setValue(video_cache / 10);
|
||||
|
||||
boolean minimized = sharedpref.getBoolean(getString(R.string.set_video_minimize_choice), true);
|
||||
SwitchPreference set_video_minimize_choice = findPreference(getString(R.string.set_video_minimize_choice));
|
||||
|
@ -1,68 +0,0 @@
|
||||
package app.fedilab.fedilabtube.helper;
|
||||
/* Copyright 2020 Thomas Schneider
|
||||
*
|
||||
* This file is a part of TubeLab
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
* TubeLab 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 TubeLab; if not,
|
||||
* see <http://www.gnu.org/licenses>. */
|
||||
|
||||
import android.graphics.Canvas;
|
||||
import android.graphics.Paint;
|
||||
import android.text.Layout;
|
||||
import android.text.style.LeadingMarginSpan;
|
||||
import android.text.style.LineBackgroundSpan;
|
||||
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
/**
|
||||
* Original work from @heath-borders: https://stackoverflow.com/a/29114976/3197259
|
||||
*/
|
||||
public class CustomQuoteSpan implements LeadingMarginSpan, LineBackgroundSpan {
|
||||
private final int backgroundColor;
|
||||
private final int stripeColor;
|
||||
private final float stripeWidth;
|
||||
private final float gap;
|
||||
|
||||
public CustomQuoteSpan(int backgroundColor, int stripeColor, float stripeWidth, float gap) {
|
||||
this.backgroundColor = backgroundColor;
|
||||
this.stripeColor = stripeColor;
|
||||
this.stripeWidth = stripeWidth;
|
||||
this.gap = gap;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getLeadingMargin(boolean first) {
|
||||
return (int) (stripeWidth + gap);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawLeadingMargin(Canvas c, Paint p, int x, int dir, int top, int baseline, int bottom,
|
||||
CharSequence text, int start, int end, boolean first, Layout layout) {
|
||||
Paint.Style style = p.getStyle();
|
||||
int paintColor = p.getColor();
|
||||
|
||||
p.setStyle(Paint.Style.FILL);
|
||||
p.setColor(stripeColor);
|
||||
|
||||
c.drawRect(x, top, x + dir * stripeWidth, bottom, p);
|
||||
|
||||
p.setStyle(style);
|
||||
p.setColor(paintColor);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawBackground(@NotNull Canvas c, @NotNull Paint p, int left, int right, int top, int baseline, int bottom, @NotNull CharSequence text, int start, int end, int lnum) {
|
||||
int paintColor = p.getColor();
|
||||
p.setColor(backgroundColor);
|
||||
c.drawRect(left, top, right, bottom, p);
|
||||
p.setColor(paintColor);
|
||||
}
|
||||
}
|
@ -1,41 +0,0 @@
|
||||
package app.fedilab.fedilabtube.helper;
|
||||
/* Copyright 2020 Thomas Schneider
|
||||
*
|
||||
* This file is a part of TubeLab
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
* TubeLab 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 TubeLab; if not,
|
||||
* see <http://www.gnu.org/licenses>. */
|
||||
|
||||
import java.util.Arrays;
|
||||
|
||||
/**
|
||||
* Work from https://stackoverflow.com/a/26420820
|
||||
*/
|
||||
|
||||
public class FileNameCleaner {
|
||||
private final static int[] illegalChars = {34, 60, 62, 124, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 58, 42, 63, 92, 47};
|
||||
|
||||
static {
|
||||
Arrays.sort(illegalChars);
|
||||
}
|
||||
|
||||
public static String cleanFileName(String badFileName) {
|
||||
StringBuilder cleanName = new StringBuilder();
|
||||
int len = badFileName.codePointCount(0, badFileName.length());
|
||||
for (int i = 0; i < len; i++) {
|
||||
int c = badFileName.codePointAt(i);
|
||||
if (Arrays.binarySearch(illegalChars, c) < 0) {
|
||||
cleanName.appendCodePoint(c);
|
||||
}
|
||||
}
|
||||
return cleanName.toString();
|
||||
}
|
||||
}
|
@ -45,7 +45,7 @@ public class FullScreenMediaController extends MediaController {
|
||||
this.context = context;
|
||||
}
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
@SuppressWarnings({"unused", "RedundantSuppression"})
|
||||
public FullScreenMediaController(Context context, Video peertube) {
|
||||
super(context);
|
||||
this.peertube = peertube;
|
||||
@ -104,7 +104,7 @@ public class FullScreenMediaController extends MediaController {
|
||||
});
|
||||
}
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
@SuppressWarnings({"unused", "RedundantSuppression"})
|
||||
public void setResolutionVal(String resolutionVal) {
|
||||
this.resolutionVal = resolutionVal;
|
||||
if (resolution != null)
|
||||
|
@ -26,7 +26,6 @@ import android.graphics.Bitmap;
|
||||
import android.graphics.Color;
|
||||
import android.net.Uri;
|
||||
import android.os.Build;
|
||||
import android.os.Bundle;
|
||||
import android.os.Environment;
|
||||
import android.util.DisplayMetrics;
|
||||
import android.util.TypedValue;
|
||||
@ -40,7 +39,6 @@ import android.widget.ImageView;
|
||||
import android.widget.Toast;
|
||||
|
||||
import androidx.appcompat.app.AlertDialog;
|
||||
import androidx.browser.customtabs.CustomTabsIntent;
|
||||
import androidx.core.content.ContextCompat;
|
||||
|
||||
import com.bumptech.glide.Glide;
|
||||
@ -49,12 +47,10 @@ import com.bumptech.glide.load.resource.bitmap.RoundedCorners;
|
||||
import com.bumptech.glide.request.RequestOptions;
|
||||
|
||||
import java.text.DateFormat;
|
||||
import java.text.ParseException;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
import java.util.TimeZone;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
import app.fedilab.fedilabtube.BuildConfig;
|
||||
@ -82,51 +78,34 @@ public class Helper {
|
||||
public static final int QUALITY_HIGH = 0;
|
||||
public static final int QUALITY_MEDIUM = 1;
|
||||
public static final int QUALITY_LOW = 2;
|
||||
public static final int VIDEO_MODE_TORRENT = 3;
|
||||
public static final int ADD_USER_INTENT = 5;
|
||||
public static final int VIDEO_UPLOADED_INTENT = 6;
|
||||
public static final String VIDEO_UPLOAD_ID = "VIDEO_UPLOAD_ID";
|
||||
public static final String SET_SHARE_DETAILS = "set_share_details";
|
||||
public static final int DEFAULT_VIDEO_CACHE_MB = 100;
|
||||
@SuppressWarnings({"unused", "RedundantSuppression"})
|
||||
public static final String TAG = "mastodon_etalab";
|
||||
public static final String ID = "id";
|
||||
public static final String CLIENT_ID = "client_id";
|
||||
public static final String CLIENT_SECRET = "client_secret";
|
||||
public static final String SCOPES = "scopes";
|
||||
public static final String WEBSITE = "website";
|
||||
public static final String WEBSITE_VALUE = "https://fedilab.app";
|
||||
public static final String CLIENT_NAME_VALUE = "TubeLab";
|
||||
public static final String OAUTH_SCOPES_PEERTUBE = "openid profile";
|
||||
public static final String PREF_KEY_OAUTH_TOKEN = "oauth_token";
|
||||
public static final String REDIRECT_URIS = "redirect_uris";
|
||||
|
||||
public static final Pattern hashtagPattern = Pattern.compile("(#[\\w_A-zÀ-ÿ]+)");
|
||||
public static final Pattern redirectPattern = Pattern.compile("externalAuthToken=(\\w+)&username=([\\w.-]+)");
|
||||
public static final String SET_VIDEO_CACHE = "set_video_cache";
|
||||
//Proxy
|
||||
public static final String SET_PROXY_ENABLED = "set_proxy_enabled";
|
||||
public static final String SET_PROXY_TYPE = "set_proxy_type";
|
||||
public static final String SET_PROXY_HOST = "set_proxy_host";
|
||||
public static final String SET_PROXY_PORT = "set_proxy_port";
|
||||
public static final String SET_PROXY_LOGIN = "set_proxy_login";
|
||||
public static final String SET_PROXY_PASSWORD = "set_proxy_password";
|
||||
public static final String INTENT_ACTION = "intent_action";
|
||||
public static final String PREF_KEY_ID = "userID";
|
||||
public static final String PREF_KEY_NAME = "my_user_name";
|
||||
public static final String PREF_IS_MODERATOR = "is_moderator";
|
||||
public static final String PREF_IS_ADMINISTRATOR = "is_administrator";
|
||||
public static final String PREF_INSTANCE = "instance";
|
||||
public static final String REDIRECT_CONTENT = "urn:ietf:wg:oauth:2.0:oob";
|
||||
public static final int EXTERNAL_STORAGE_REQUEST_CODE = 84;
|
||||
public static final String SET_VIDEOS_PER_PAGE = "set_videos_per_page";
|
||||
public static final String VIDEO_ID = "video_id_update";
|
||||
public static final String CLIENT_NAME = "client_name";
|
||||
public static final String APP_PREFS = "app_prefs";
|
||||
|
||||
public static final int VIDEOS_PER_PAGE = 40;
|
||||
public static final String SET_VIDEO_NSFW = "set_video_nsfw";
|
||||
public static final String SET_EMBEDDED_BROWSER = "set_embedded_browser";
|
||||
public static final String SET_CUSTOM_TABS = "set_custom_tabs";
|
||||
public static final String INTENT_ADD_UPLOADED_MEDIA = "intent_add_uploaded_media";
|
||||
public static final String RECEIVE_ACTION = "receive_action";
|
||||
public static final String SET_UNFOLLOW_VALIDATION = "set_unfollow_validation";
|
||||
@ -268,42 +247,6 @@ public class Helper {
|
||||
}
|
||||
}
|
||||
|
||||
public static String instanceWithProtocol(Context context) {
|
||||
return "https://" + getLiveInstance(context);
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert String date from Mastodon
|
||||
*
|
||||
* @param date String
|
||||
* @return Date
|
||||
*/
|
||||
public static Date mstStringToDate(String date) throws ParseException {
|
||||
if (date == null)
|
||||
return null;
|
||||
|
||||
String STRING_DATE_FORMAT;
|
||||
Locale local = Locale.getDefault();
|
||||
if (!date.contains("+")) {
|
||||
STRING_DATE_FORMAT = "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'";
|
||||
} else { //GNU date format
|
||||
STRING_DATE_FORMAT = "EEE MMM dd HH:mm:ss ZZZZZ yyyy";
|
||||
local = Locale.ENGLISH;
|
||||
}
|
||||
SimpleDateFormat simpleDateFormat = new SimpleDateFormat(STRING_DATE_FORMAT, local);
|
||||
simpleDateFormat.setTimeZone(TimeZone.getTimeZone("gmt"));
|
||||
simpleDateFormat.setLenient(true);
|
||||
try {
|
||||
return simpleDateFormat.parse(date);
|
||||
} catch (Exception e) {
|
||||
String newdate = date.split("\\+")[0].trim();
|
||||
simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss", local);
|
||||
simpleDateFormat.setTimeZone(TimeZone.getTimeZone("gmt"));
|
||||
simpleDateFormat.setLenient(true);
|
||||
return simpleDateFormat.parse(newdate);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert a date in String -> format yyyy-MM-dd HH:mm:ss
|
||||
*
|
||||
@ -386,7 +329,7 @@ public class Helper {
|
||||
SimpleDateFormat df = (SimpleDateFormat) DateFormat.getDateInstance(DateFormat.LONG, Locale.getDefault());
|
||||
df.applyPattern(df.toPattern().replaceAll("[^\\p{Alpha}]*y+[^\\p{Alpha}]*", ""));
|
||||
return df.format(dateToot);
|
||||
}catch (Exception e) {
|
||||
} catch (Exception e) {
|
||||
return format;
|
||||
}
|
||||
} else if (days > 0)
|
||||
@ -402,17 +345,6 @@ public class Helper {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert a date in String -> format yyyy-MM-dd HH:mm:ss
|
||||
*
|
||||
* @param date Date
|
||||
* @return String
|
||||
*/
|
||||
public static String shortDateToString(Date date) {
|
||||
SimpleDateFormat df = (SimpleDateFormat) DateFormat.getDateInstance(DateFormat.SHORT, Locale.getDefault());
|
||||
return df.format(date);
|
||||
}
|
||||
|
||||
|
||||
public static String withSuffix(long count) {
|
||||
if (count < 1000) return "" + count;
|
||||
@ -471,50 +403,6 @@ public class Helper {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Manage URLs to open (built-in or external app)
|
||||
*
|
||||
* @param context Context
|
||||
* @param url String url to open
|
||||
*/
|
||||
public static void openBrowser(Context context, String url) {
|
||||
SharedPreferences sharedpreferences = context.getSharedPreferences(Helper.APP_PREFS, android.content.Context.MODE_PRIVATE);
|
||||
boolean embedded_browser = sharedpreferences.getBoolean(Helper.SET_EMBEDDED_BROWSER, true);
|
||||
if (embedded_browser) {
|
||||
Intent intent = new Intent(context, WebviewActivity.class);
|
||||
Bundle b = new Bundle();
|
||||
String finalUrl = url;
|
||||
if (!url.toLowerCase().startsWith("http://") && !url.toLowerCase().startsWith("https://"))
|
||||
finalUrl = "http://" + url;
|
||||
b.putString("url", finalUrl);
|
||||
intent.putExtras(b);
|
||||
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
|
||||
context.startActivity(intent);
|
||||
} else {
|
||||
boolean custom_tabs = sharedpreferences.getBoolean(Helper.SET_CUSTOM_TABS, true);
|
||||
if (custom_tabs) {
|
||||
CustomTabsIntent.Builder builder = new CustomTabsIntent.Builder();
|
||||
CustomTabsIntent customTabsIntent = builder.build();
|
||||
builder.setToolbarColor(ContextCompat.getColor(context, getColorPrimary()));
|
||||
try {
|
||||
customTabsIntent.launchUrl(context, Uri.parse(url));
|
||||
} catch (Exception ignored) {
|
||||
Toasty.error(context, context.getString(R.string.toast_error), Toast.LENGTH_LONG).show();
|
||||
}
|
||||
} else {
|
||||
Intent intent = new Intent(Intent.ACTION_VIEW);
|
||||
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
|
||||
intent.setData(Uri.parse(url));
|
||||
try {
|
||||
context.startActivity(intent);
|
||||
} catch (Exception e) {
|
||||
Toasty.error(context, context.getString(R.string.toast_error), Toast.LENGTH_LONG).show();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@SuppressLint("SetJavaScriptEnabled")
|
||||
public static CustomWebview initializeWebview(Activity activity, int webviewId, View rootView) {
|
||||
@ -678,9 +566,6 @@ public class Helper {
|
||||
return BuildConfig.full_instances ? R.color.colorAccent_full : R.color.colorAccent;
|
||||
}
|
||||
|
||||
public static int getColorPrimary() {
|
||||
return BuildConfig.full_instances ? R.color.colorPrimary_full : R.color.colorPrimary;
|
||||
}
|
||||
|
||||
public static boolean isOwner(Context context, Account account) {
|
||||
SharedPreferences sharedpreferences = context.getSharedPreferences(Helper.APP_PREFS, Context.MODE_PRIVATE);
|
||||
@ -699,21 +584,18 @@ public class Helper {
|
||||
* @param files List<File>
|
||||
* @return File
|
||||
*/
|
||||
public static File defaultFile(Context context, List<File> files){
|
||||
if( files == null || files.size() == 0){
|
||||
return null;
|
||||
}
|
||||
public static File defaultFile(Context context, List<File> files) {
|
||||
SharedPreferences sharedpreferences = context.getSharedPreferences(Helper.APP_PREFS, Context.MODE_PRIVATE);
|
||||
int video_quality = sharedpreferences.getInt(Helper.SET_QUALITY_MODE, Helper.QUALITY_HIGH);
|
||||
if( video_quality == QUALITY_HIGH) {
|
||||
if (video_quality == QUALITY_HIGH) {
|
||||
return files.get(0);
|
||||
}else if( video_quality == QUALITY_LOW) {
|
||||
return files.get(files.size() -1);
|
||||
}else{
|
||||
if( files.size() < 3) {
|
||||
return files.get(files.size() -1);
|
||||
}else{
|
||||
int middle = files.size()/2 -1;
|
||||
} else if (video_quality == QUALITY_LOW) {
|
||||
return files.get(files.size() - 1);
|
||||
} else {
|
||||
if (files.size() < 3) {
|
||||
return files.get(files.size() - 1);
|
||||
} else {
|
||||
int middle = files.size() / 2 - 1;
|
||||
return files.get(middle);
|
||||
}
|
||||
}
|
||||
|
@ -300,7 +300,7 @@ public class AccountDAO {
|
||||
account.setClient_secret(c.getString(c.getColumnIndex(Sqlite.COL_CLIENT_SECRET)));
|
||||
account.setRefresh_token(c.getString(c.getColumnIndex(Sqlite.COL_REFRESH_TOKEN)));
|
||||
//Close the cursor
|
||||
c.close();
|
||||
c.close();
|
||||
|
||||
//User is returned
|
||||
return account;
|
||||
@ -348,5 +348,4 @@ public class AccountDAO {
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
@ -41,12 +41,6 @@ public class CaptionsVM extends AndroidViewModel {
|
||||
return apiResponseMutableLiveData;
|
||||
}
|
||||
|
||||
public LiveData<APIResponse> loadCaption(String url) {
|
||||
apiResponseMutableLiveData = new MutableLiveData<>();
|
||||
load(url);
|
||||
return apiResponseMutableLiveData;
|
||||
}
|
||||
|
||||
private void loadCaptions(String videoId) {
|
||||
Context _mContext = getApplication().getApplicationContext();
|
||||
new Thread(() -> {
|
||||
@ -61,20 +55,4 @@ public class CaptionsVM extends AndroidViewModel {
|
||||
}
|
||||
}).start();
|
||||
}
|
||||
|
||||
private void load(String url) {
|
||||
Context _mContext = getApplication().getApplicationContext();
|
||||
new Thread(() -> {
|
||||
try {
|
||||
RetrofitPeertubeAPI peertubeAPI = new RetrofitPeertubeAPI(_mContext);
|
||||
APIResponse apiResponse = peertubeAPI.getCaptionContent(url);
|
||||
Handler mainHandler = new Handler(Looper.getMainLooper());
|
||||
Runnable myRunnable = () -> apiResponseMutableLiveData.setValue(apiResponse);
|
||||
mainHandler.post(myRunnable);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}).start();
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -27,15 +27,12 @@ import androidx.lifecycle.AndroidViewModel;
|
||||
import androidx.lifecycle.LiveData;
|
||||
import androidx.lifecycle.MutableLiveData;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import app.fedilab.fedilabtube.client.APIResponse;
|
||||
import app.fedilab.fedilabtube.client.RetrofitPeertubeAPI;
|
||||
import app.fedilab.fedilabtube.client.data.AccountData.Account;
|
||||
import app.fedilab.fedilabtube.client.data.PlaylistData.Playlist;
|
||||
import app.fedilab.fedilabtube.client.entities.PlaylistParams;
|
||||
import app.fedilab.fedilabtube.helper.Helper;
|
||||
import app.fedilab.fedilabtube.sqlite.AccountDAO;
|
||||
import app.fedilab.fedilabtube.sqlite.Sqlite;
|
||||
@ -54,13 +51,13 @@ public class PlaylistsVM extends AndroidViewModel {
|
||||
return apiResponseMutableLiveData;
|
||||
}
|
||||
|
||||
public LiveData<APIResponse> videoExists(List<String> videoIds) {
|
||||
public LiveData<APIResponse> videoExists(String videoIds) {
|
||||
apiResponseMutableLiveData = new MutableLiveData<>();
|
||||
checkVideosExist(videoIds);
|
||||
return apiResponseMutableLiveData;
|
||||
}
|
||||
|
||||
private void checkVideosExist(List<String> videoIds) {
|
||||
private void checkVideosExist(String videoIds) {
|
||||
Context _mContext = getApplication().getApplicationContext();
|
||||
new Thread(() -> {
|
||||
APIResponse apiResponse = new RetrofitPeertubeAPI(_mContext).getVideosExist(videoIds);
|
||||
|
@ -62,10 +62,12 @@
|
||||
android:gravity="center"
|
||||
android:visibility="gone">
|
||||
|
||||
<ProgressBar
|
||||
<com.github.ybq.android.spinkit.SpinKitView xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
style="@style/progress"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:indeterminate="true" />
|
||||
android:layout_gravity="center"
|
||||
app:SpinKit_Color="?colorAccent" />
|
||||
</RelativeLayout>
|
||||
<!-- Loader for next items -->
|
||||
<RelativeLayout
|
||||
@ -77,10 +79,12 @@
|
||||
android:gravity="bottom|center_horizontal"
|
||||
android:visibility="gone">
|
||||
|
||||
<ProgressBar
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:indeterminate="true" />
|
||||
<com.github.ybq.android.spinkit.SpinKitView xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
style="@style/progressBottom"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
app:SpinKit_Color="?colorAccent" />
|
||||
</RelativeLayout>
|
||||
|
||||
</RelativeLayout>
|
||||
|
@ -118,10 +118,12 @@
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/filters_container">
|
||||
|
||||
<ProgressBar
|
||||
<com.github.ybq.android.spinkit.SpinKitView
|
||||
style="@style/progress"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:indeterminate="true" />
|
||||
android:layout_gravity="center"
|
||||
app:SpinKit_Color="?colorAccent" />
|
||||
</RelativeLayout>
|
||||
|
||||
<LinearLayout
|
||||
|
@ -55,6 +55,7 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
app:defaultNavHost="true"
|
||||
android:layout_marginBottom="?attr/actionBarSize"
|
||||
app:navGraph="@navigation/mobile_navigation" />
|
||||
<com.google.android.material.bottomnavigation.BottomNavigationView
|
||||
android:id="@+id/nav_view"
|
||||
|
@ -67,10 +67,11 @@
|
||||
android:gravity="center"
|
||||
android:visibility="gone">
|
||||
|
||||
<ProgressBar
|
||||
<com.github.ybq.android.spinkit.SpinKitView
|
||||
style="@style/SpinKitView.DoubleBounce"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:indeterminate="true" />
|
||||
android:layout_gravity="center" />
|
||||
</RelativeLayout>
|
||||
</RelativeLayout>
|
||||
|
||||
|
@ -65,10 +65,12 @@
|
||||
android:gravity="center"
|
||||
android:visibility="gone">
|
||||
|
||||
<ProgressBar
|
||||
<com.github.ybq.android.spinkit.SpinKitView xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
style="@style/progress"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:indeterminate="true" />
|
||||
android:layout_gravity="center"
|
||||
app:SpinKit_Color="?colorAccent" />
|
||||
</RelativeLayout>
|
||||
<!-- Loader for next status -->
|
||||
<RelativeLayout
|
||||
@ -80,10 +82,12 @@
|
||||
android:gravity="bottom|center_horizontal"
|
||||
android:visibility="gone">
|
||||
|
||||
<ProgressBar
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:indeterminate="true" />
|
||||
<com.github.ybq.android.spinkit.SpinKitView xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
style="@style/progressBottom"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
app:SpinKit_Color="?colorAccent" />
|
||||
</RelativeLayout>
|
||||
</RelativeLayout>
|
||||
</androidx.coordinatorlayout.widget.CoordinatorLayout>
|
||||
|
@ -71,10 +71,12 @@
|
||||
android:gravity="center"
|
||||
android:visibility="gone">
|
||||
|
||||
<ProgressBar
|
||||
<com.github.ybq.android.spinkit.SpinKitView
|
||||
style="@style/progress"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:indeterminate="true" />
|
||||
android:layout_gravity="center"
|
||||
app:SpinKit_Color="?colorAccent" />
|
||||
</RelativeLayout>
|
||||
<!-- Loader for next videos -->
|
||||
<RelativeLayout
|
||||
@ -87,10 +89,12 @@
|
||||
android:visibility="gone"
|
||||
app:layout_constraintBottom_toBottomOf="parent">
|
||||
|
||||
<ProgressBar
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:indeterminate="true" />
|
||||
<com.github.ybq.android.spinkit.SpinKitView
|
||||
style="@style/progressBottom"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
app:SpinKit_Color="?colorAccent" />
|
||||
</RelativeLayout>
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
</androidx.core.widget.NestedScrollView>
|
@ -51,10 +51,12 @@
|
||||
android:gravity="center"
|
||||
android:visibility="gone">
|
||||
|
||||
<ProgressBar
|
||||
<com.github.ybq.android.spinkit.SpinKitView xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
style="@style/progress"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:indeterminate="true" />
|
||||
android:layout_gravity="center"
|
||||
app:SpinKit_Color="?colorAccent" />
|
||||
</RelativeLayout>
|
||||
<!-- Loader for next items -->
|
||||
<RelativeLayout
|
||||
@ -66,10 +68,12 @@
|
||||
android:gravity="bottom|center_horizontal"
|
||||
android:visibility="gone">
|
||||
|
||||
<ProgressBar
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:indeterminate="true" />
|
||||
<com.github.ybq.android.spinkit.SpinKitView xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
style="@style/progressBottom"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
app:SpinKit_Color="?colorAccent" />
|
||||
</RelativeLayout>
|
||||
|
||||
<com.google.android.material.floatingactionbutton.FloatingActionButton
|
||||
|
@ -57,10 +57,12 @@
|
||||
android:gravity="center"
|
||||
android:visibility="gone">
|
||||
|
||||
<ProgressBar
|
||||
<com.github.ybq.android.spinkit.SpinKitView xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
style="@style/progress"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:indeterminate="true" />
|
||||
android:layout_gravity="center"
|
||||
app:SpinKit_Color="?colorAccent" />
|
||||
</RelativeLayout>
|
||||
<!-- Loader for next accounts -->
|
||||
<RelativeLayout
|
||||
@ -72,10 +74,12 @@
|
||||
android:gravity="bottom|center_horizontal"
|
||||
android:visibility="gone">
|
||||
|
||||
<ProgressBar
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:indeterminate="true" />
|
||||
<com.github.ybq.android.spinkit.SpinKitView xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
style="@style/progressBottom"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
app:SpinKit_Color="?colorAccent" />
|
||||
</RelativeLayout>
|
||||
</RelativeLayout>
|
||||
|
||||
|
@ -100,10 +100,12 @@
|
||||
android:gravity="center"
|
||||
android:visibility="gone">
|
||||
|
||||
<ProgressBar
|
||||
<com.github.ybq.android.spinkit.SpinKitView
|
||||
style="@style/progress"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:indeterminate="true" />
|
||||
android:layout_gravity="center"
|
||||
app:SpinKit_Color="?colorAccent" />
|
||||
</RelativeLayout>
|
||||
<!-- Loader for next videos -->
|
||||
<RelativeLayout
|
||||
@ -116,10 +118,12 @@
|
||||
android:visibility="gone"
|
||||
app:layout_constraintBottom_toBottomOf="parent">
|
||||
|
||||
<ProgressBar
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:indeterminate="true" />
|
||||
<com.github.ybq.android.spinkit.SpinKitView
|
||||
style="@style/progressBottom"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
app:SpinKit_Color="?colorAccent" />
|
||||
</RelativeLayout>
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
</androidx.core.widget.NestedScrollView>
|
Loading…
x
Reference in New Issue
Block a user