mirror of
https://framagit.org/tom79/fedilab-tube
synced 2025-06-05 21:09:11 +02:00
Compare commits
71 Commits
Author | SHA1 | Date | |
---|---|---|---|
6ae42ffefe | |||
3a8c82ce63 | |||
04c2b277ce | |||
962462ff84 | |||
964b0f2690 | |||
4b25b61680 | |||
61c3735e57 | |||
b0e29c0ba4 | |||
e7f55aace9 | |||
2955206b07 | |||
b59d97279d | |||
7d9e299940 | |||
e15252a0f8 | |||
e0907f1dc8 | |||
1107391c43 | |||
2500035c33 | |||
24ad4dbc0f | |||
550394a5e4 | |||
720c13fa2d | |||
a02b8b79c1 | |||
c2f99e130d | |||
250aa03e9a | |||
dd7d253a1b | |||
f2b46fffe0 | |||
60630cc4ea | |||
85164c18e9 | |||
3634e5e232 | |||
f7d44cb547 | |||
85b89507db | |||
7415b752cc | |||
0a52060223 | |||
1024b1e6f9 | |||
23fc061711 | |||
bfa3ede06b | |||
c7f6cdc8c6 | |||
58f280d347 | |||
0715824ae1 | |||
5540c8cacc | |||
14efbdd08f | |||
7ceb04d548 | |||
e9608f63db | |||
64e1c7ca81 | |||
7823b30900 | |||
1e45e4454c | |||
1dd3a193c5 | |||
30416837a9 | |||
363132d331 | |||
ebc0d744ed | |||
d685031ee8 | |||
3ea012f62e | |||
9a06f5660b | |||
dff76aada1 | |||
50a9f8a1b0 | |||
8ff3b81112 | |||
38f73a5d60 | |||
15f6835a0c | |||
84e3264726 | |||
dbd068d95f | |||
acba219e44 | |||
c8e7c23855 | |||
f0ff8a6feb | |||
91a1380fef | |||
3351ef7d91 | |||
564cda58a5 | |||
3233fe673d | |||
8cc8b284ce | |||
3ecdedc17c | |||
8f361c605a | |||
9d599e8b57 | |||
9c676d8002 | |||
8c95554d8e |
@ -6,7 +6,7 @@ The other app is **[TubeLab](#TubeLab)** a Peertube Android app working for all
|
||||
|
||||
## <a name="TubeLab">TubeLab</a>
|
||||
|
||||
Tubelab is an Android app for Peertube (GNU GPLv3).
|
||||
Tubelab is an Android app for Peertube (GNU GPLv3). <img src='https://img.shields.io/f-droid/v/app.fedilab.tubelab?include_prereleases' />
|
||||
|
||||
[<img alt='Get it on Google Play' src='./images/get-it-on-play.png' height="80"/>](https://play.google.com/store/apps/details?id=app.fedilab.tubelab)
|
||||
[<img alt='Get it on F-Droid' src='./images/get-it-on-fdroid.png' height="80"/>](https://f-droid.org/packages/app.fedilab.tubelab/)
|
||||
|
@ -11,8 +11,8 @@ android {
|
||||
|
||||
minSdkVersion 21
|
||||
targetSdkVersion 30
|
||||
versionCode 25
|
||||
versionName "1.7.0"
|
||||
versionCode 29
|
||||
versionName "1.9.0"
|
||||
multiDexEnabled true
|
||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||
}
|
||||
@ -118,8 +118,8 @@ dependencies {
|
||||
implementation "com.github.bumptech.glide:glide:4.11.0"
|
||||
annotationProcessor "com.github.bumptech.glide:compiler:4.11.0"
|
||||
implementation "androidx.swiperefreshlayout:swiperefreshlayout:1.1.0"
|
||||
implementation "net.gotev:uploadservice:3.5.2"
|
||||
implementation "net.gotev:uploadservice-okhttp:3.5.2"
|
||||
implementation "net.gotev:uploadservice:4.5.1"
|
||||
implementation "net.gotev:uploadservice-okhttp:4.5.1"
|
||||
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'
|
||||
|
@ -8,6 +8,7 @@
|
||||
<color name="tag_color_text">#FAFAFA</color>
|
||||
<color name="positive_thumbs">#2b90d9</color>
|
||||
<color name="negative_thumbs">#F44336</color>
|
||||
|
||||
<color name="backgroundDark">#DD000000</color>
|
||||
<color name="red_1">#F44336</color>
|
||||
<color name="gray_light">#80808080</color>
|
||||
</resources>
|
@ -18,8 +18,12 @@
|
||||
<string name="set_video_in_list">Vidéos dans une liste</string>
|
||||
<string name="set_video_in_list_description">Change la mise en page pour afficher les vidéos dans une liste</string>
|
||||
|
||||
<string name="_retry">Réessayer</string>
|
||||
<string name="refresh_token_failed">Échec de rafraîchissement du jeton d\'accès</string>
|
||||
<string name="refresh_token_failed_message">Vous pouvez réessayer de le rafraîchir ou simplement déconnecter le compte</string>
|
||||
<string name="export_list">Exporter</string>
|
||||
<string name="import_list">Importer</string>
|
||||
<string name="originally_published">Date de publication</string>
|
||||
|
||||
<string name="delete_history">Supprimer l\'historique de vidéos</string>
|
||||
<string name="delete_history_confirm">Êtes vous sur de vouloir supprimer toutes les vidéos de votre historique ?</string>
|
||||
@ -201,6 +205,9 @@
|
||||
<string name="all_of_these_tags">Tous ces labels</string>
|
||||
<string name="one_of_these_tags">Un de ces labels</string>
|
||||
<string name="apply_filter">Appliquer le filtre</string>
|
||||
|
||||
<string name="playback_speed">Vitesse du lecteur</string>
|
||||
<string name="normal">Normal</string>
|
||||
<string-array name="sort_by_array">
|
||||
<item>Meilleurs résultats</item>
|
||||
<item>Les plus récentes</item>
|
||||
@ -300,6 +307,15 @@
|
||||
<item>Moyenne</item>
|
||||
<item>Faible</item>
|
||||
</string-array>
|
||||
|
||||
<string name="unlimited">Illimité</string>
|
||||
<string name="mb">Mo</string>
|
||||
<string name="gb">Go</string>
|
||||
<string name="total_video_quota">Total du quota vidéo</string>
|
||||
<string name="daily_video_quota">Quota vidéo journalier</string>
|
||||
<string name="nsfw_title_warning">Contenu explicite ou sensible</string>
|
||||
<string name="nsfw_message_warning">Cette vidéo contient du contenu sensible. Êtes-vous sûr·e de vouloir la regarder ?</string>
|
||||
<string name="set_autoplay_next_video_settings">Lecture automatique</string>
|
||||
<string name="unfollow_confirm">Voulez-vous vous désabonner de ce compte ?</string>
|
||||
<string name="no_playlist">Aucune liste de lecture !</string>
|
||||
<string name="title_video_peertube">Titre de la vidéo</string>
|
||||
|
@ -12,7 +12,7 @@ C'est un mode limité où vous pouvez faire certaines actions:
|
||||
De nombreuses fonctionnalités sont disponibles avec ce mode:
|
||||
|
||||
- Rédiger/supprimer des commentaires
|
||||
- Télécharger/supprimer/modifier des vidéos
|
||||
- Téléverser/supprimer/modifier des vidéos
|
||||
- Gérer (créer/modifier/supprimer) les chaînes et les listes de lecture
|
||||
- Suivre/ne pas suivre les canaux
|
||||
- Pouces vers le haut/vers le bas
|
||||
|
@ -1,14 +1,15 @@
|
||||
Added:
|
||||
- Display follow button for Sepia Search
|
||||
- Reach owner from channels
|
||||
- Surfing mode (store instances in db with quick switch)
|
||||
- Allow to delete history
|
||||
- Allow to search channels
|
||||
- Show storage quota
|
||||
- Warning on Playing NSFW videos
|
||||
- Swipe to change timelines
|
||||
|
||||
Changed:
|
||||
- Quicker access to account settings
|
||||
- Improve landscape mode
|
||||
- Improve comment threads
|
||||
- Comment composer in full-screen
|
||||
- Swipe to change timeline
|
||||
|
||||
Fix:
|
||||
- Pull to refresh crashes
|
||||
- Settings crashes
|
||||
- Fix an issue with unlisted playlists
|
||||
Fixed:
|
||||
- Status bar for fullscreen not removed
|
||||
- Filter for subscriptions not working with remote accounts
|
||||
- Some crashes
|
@ -14,9 +14,11 @@
|
||||
<string name="set_autoplay_description">If enabled, videos will be played automatically</string>
|
||||
<string name="set_fullscreen">Fullscreen</string>
|
||||
<string name="set_fullscreen_description">Automatically open videos in fullscreen</string>
|
||||
<string name="set_autoplay_next_video_settings">Autoplay</string>
|
||||
<string name="set_autoplay_next_video">Automatically start playing the next video</string>
|
||||
<string name="set_autoplay_next_video_description">When a video ends, follow up with the next suggested video.</string>
|
||||
<string name="add_public_reply">Add a public reply</string>
|
||||
<string name="originally_published">Originally published</string>
|
||||
<string name="activity">Activity</string>
|
||||
<string name="app">App</string>
|
||||
<string name="notif_new_video">New video from your subscriptions</string>
|
||||
@ -84,6 +86,9 @@
|
||||
<item>6 hours</item>
|
||||
<item>12 hours</item>
|
||||
</string-array>
|
||||
<string name="_retry">Retry</string>
|
||||
<string name="refresh_token_failed">Token refresh failed!</string>
|
||||
<string name="refresh_token_failed_message">You can retry this action or simply disconnect the current account</string>
|
||||
<string name="yes">موافق</string>
|
||||
<string name="no">لا</string>
|
||||
<string name="cancel">إلغاء</string>
|
||||
@ -122,8 +127,15 @@
|
||||
<string name="toast_error_loading_account">طرأ هناك خطأ أثناء التحوّل مِن حساب إلى آخر!</string>
|
||||
<string name="toast_error_search">وقع خطأ أثناء عملية البحث!</string>
|
||||
<string name="nothing_to_do">لا يمكن اتخاذ أي إجراء</string>
|
||||
<string name="action_follow">اتبع</string>
|
||||
<string name="action_follow">Subscribe</string>
|
||||
<string name="action_mute">كتم</string>
|
||||
<string name="unlimited">Unlimited</string>
|
||||
<string name="mb">MB</string>
|
||||
<string name="gb">GB</string>
|
||||
<string name="total_video_quota">Total video quota</string>
|
||||
<string name="daily_video_quota">Daily video quota</string>
|
||||
<string name="nsfw_title_warning">Mature or explicit content</string>
|
||||
<string name="nsfw_message_warning">This video contains mature or explicit content. Are you sure you want to watch it?</string>
|
||||
<string name="search">البحث</string>
|
||||
<string name="delete">حذف</string>
|
||||
<string name="action_lists_confirm_delete">هل تود فعلا حذف هذه القائمة ؟</string>
|
||||
@ -223,6 +235,8 @@
|
||||
<string name="send_comment">ارسل تعليق</string>
|
||||
<string name="all">الكل</string>
|
||||
<!-- end languages -->
|
||||
<string name="playback_speed">Playback speed</string>
|
||||
<string name="normal">Normal</string>
|
||||
<string name="delete_history">Delete videos history</string>
|
||||
<string name="delete_history_confirm">Are you sure you want to delete all your videos history?</string>
|
||||
<string name="export_list">Export</string>
|
||||
@ -281,7 +295,7 @@
|
||||
<string name="agreement_check_peertube">أبلُغ مِن العُمر 16 سنة على الأقل وأوافق على %1$s هذا الخادم</string>
|
||||
<string name="edit_profile">عدّل الصفحة التعريفية</string>
|
||||
<string name="make_an_action">القيام بإجراء</string>
|
||||
<string name="action_unfollow">إلغاء المتابعة</string>
|
||||
<string name="action_unfollow">Unsubscribe</string>
|
||||
<string name="display_nsfw_videos">Display sensitive videos</string>
|
||||
<string name="fullscreen">Fullscreen</string>
|
||||
<string name="bookmark_peertube_empty">There are no videos in your favourites!</string>
|
||||
|
@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources xmlns:tools="http://schemas.android.com/tools">
|
||||
<string name="set_video_in_list">Videoliste</string>
|
||||
<string name="set_video_in_list_description">Layout für die Anzeige von Videos in einer Liste ändern</string>
|
||||
<string name="set_video_in_list">Listenmodus</string>
|
||||
<string name="set_video_in_list_description">Video-Übersicht als Liste anzeigen</string>
|
||||
<string name="no_instances">Keine Instanzen !</string>
|
||||
<string name="show_more">Mehr anzeigen</string>
|
||||
<string name="show_less">Weniger anzeigen</string>
|
||||
@ -14,15 +14,17 @@
|
||||
<string name="set_autoplay_description">Wenn aktiviert, werden Videos automatisch abgespielt</string>
|
||||
<string name="set_fullscreen">Vollbild</string>
|
||||
<string name="set_fullscreen_description">Videos automatisch im Vollbildmodus öffnen</string>
|
||||
<string name="set_autoplay_next_video_settings">Automatische Wiedergabe</string>
|
||||
<string name="set_autoplay_next_video">Automatisch nächstes Video starten</string>
|
||||
<string name="set_autoplay_next_video_description">Wenn ein Video endet, nächstes vorgeschlagene starten.</string>
|
||||
<string name="add_public_reply">Öffentliche Antwort hinzufügen</string>
|
||||
<string name="originally_published">Ursprünglich veröffentlicht</string>
|
||||
<string name="activity">Aktivität</string>
|
||||
<string name="app">Anwendung</string>
|
||||
<string name="notif_new_video">Neues Video aus deinen Abonnements</string>
|
||||
<string name="notif_new_comment">Neuer Kommentar zu deinem Video</string>
|
||||
<string name="notif_blocked">Eines deiner Videos ist blockiert/entsperrt</string>
|
||||
<string name="notif_video_published">Video veröffentlicht (nach Umkodierung/geplantem Update)</string>
|
||||
<string name="notif_video_published">Video veröffentlicht (nach Umkodierung/geplanter Aktualisierung)</string>
|
||||
<string name="notif_video_imported">Videoimport abgeschlossen</string>
|
||||
<string name="notif_new_followers">Du oder dein Kanal(e) haben einen neuen Follower</string>
|
||||
<string name="notif_video_mention">Jemand hat dich in einem Kommentar erwähnt</string>
|
||||
@ -56,13 +58,13 @@
|
||||
<string name="no_notifications">Keine Benachrichtigungen!</string>
|
||||
<string name="favicon">Favicon</string>
|
||||
<string name="open_with">Öffnen mit</string>
|
||||
<string name="action_playlist_edit">Playlist bearbeiten</string>
|
||||
<string name="action_playlist_edit">Wiedergabeliste bearbeiten</string>
|
||||
<string name="close">Schließen</string>
|
||||
<string name="upload_video">Hochladen</string>
|
||||
<string name="image_preview">Bildvorschau</string>
|
||||
<string name="file_to_upload">Datei zum Hochladen auswählen</string>
|
||||
<string name="new_video">Neues Video</string>
|
||||
<string name="new_blacklist">Neue Blacklist Info</string>
|
||||
<string name="new_blacklist">Neue Schwarze-Liste-Infos</string>
|
||||
<string name="new_my_video_published">Dein Video wurde veröffentlicht</string>
|
||||
<string name="new_my_video_error">Fehler bei Veröffentlichung deines Videos</string>
|
||||
<string name="new_comment">Neuer Kommentar</string>
|
||||
@ -80,13 +82,16 @@
|
||||
<item>6 Stunden</item>
|
||||
<item>12 Stunden</item>
|
||||
</string-array>
|
||||
<string name="_retry">Retry</string>
|
||||
<string name="refresh_token_failed">Token refresh failed!</string>
|
||||
<string name="refresh_token_failed_message">You can retry this action or simply disconnect the current account</string>
|
||||
<string name="yes">Ja</string>
|
||||
<string name="no">Nein</string>
|
||||
<string name="cancel">Abbrechen</string>
|
||||
<string name="download">Herunterladen</string>
|
||||
<string name="profile_picture">Profilbild</string>
|
||||
<string name="update_video">Video aktualisieren</string>
|
||||
<string name="remove_from_playlist">Aus Playlist entfernen</string>
|
||||
<string name="remove_from_playlist">Aus Wiedergabeliste entfernen</string>
|
||||
<string name="date_seconds">%d en</string>
|
||||
<string name="date_minutes">%d en</string>
|
||||
<string name="date_hours">%d en</string>
|
||||
@ -118,8 +123,15 @@
|
||||
<string name="toast_error_loading_account">Ein Fehler ist während des Kontowechsels aufgetreten!</string>
|
||||
<string name="toast_error_search">Ein Fehler ist während der Suche aufgetreten!</string>
|
||||
<string name="nothing_to_do">Keine Aktion möglich</string>
|
||||
<string name="action_follow">Folge</string>
|
||||
<string name="action_follow">Abonnieren</string>
|
||||
<string name="action_mute">Stummschalten</string>
|
||||
<string name="unlimited">Unbegrenzt</string>
|
||||
<string name="mb">MB</string>
|
||||
<string name="gb">GB</string>
|
||||
<string name="total_video_quota">Total video quota</string>
|
||||
<string name="daily_video_quota">Daily video quota</string>
|
||||
<string name="nsfw_title_warning">Mature or explicit content</string>
|
||||
<string name="nsfw_message_warning">This video contains mature or explicit content. Are you sure you want to watch it?</string>
|
||||
<string name="search">Suche</string>
|
||||
<string name="delete">Löschen</string>
|
||||
<string name="action_lists_confirm_delete">Möchtest du diese Liste wirklich dauerhaft löschen?</string>
|
||||
@ -132,7 +144,7 @@
|
||||
<string name="information" tools:ignore="UnusedResources">Information</string>
|
||||
<string name="app_logo">Logo der Anwendung</string>
|
||||
<!-- languages not translated -->
|
||||
<string name="subscriptions">Abonnements</string>
|
||||
<string name="subscriptions">Abos</string>
|
||||
<string name="delete_instance">Eine Instanz entfernen</string>
|
||||
<string name="delete_instance_confirm">Möchtest du diese Instanz wirklich entfernen?</string>
|
||||
<string name="delete_comment">Kommentar löschen</string>
|
||||
@ -174,7 +186,7 @@
|
||||
<string name="peertube_enable_comments">Videokommentare aktivieren</string>
|
||||
<string name="description">Beschreibung</string>
|
||||
<string name="toast_peertube_video_updated">Das Video wurde aktualisiert!</string>
|
||||
<string name="register_account">Account erstellen</string>
|
||||
<string name="register_account">Konto erstellen</string>
|
||||
<string name="email_address">E‐Mail‐Adresse</string>
|
||||
<string name="preview">Vorschau</string>
|
||||
<string name="change_preview">Vorschaubild ändern</string>
|
||||
@ -206,7 +218,7 @@
|
||||
<string name="share">Teilen</string>
|
||||
<string name="peertube_comment_on_video"><![CDATA[<b>%1$s</b> hat dein Video <b>%2$s</b> kommentiert]]></string>
|
||||
<string name="peertube_follow_channel"><![CDATA[<b>%1$s</b> folgt deinem Kanal <b>%2$s</b>]]></string>
|
||||
<string name="peertube_follow_account"><![CDATA[<b>%1$s</b> folgt deinem Account]]></string>
|
||||
<string name="peertube_follow_account"><![CDATA[<b>%1$s</b> folgt deinem Konto]]></string>
|
||||
<string name="peertube_video_published"><![CDATA[Dein Video <b>%1$s</b> wurde veröffentlicht]]></string>
|
||||
<string name="peertube_video_import_success"><![CDATA[Ihr Video <b>%1$s</b> wurde erfolgreich importiert]]></string>
|
||||
<string name="peertube_video_import_error"><![CDATA[Der Import Ihres Videos <b>%1$s</b> ist fehlgeschlagen]]></string>
|
||||
@ -219,18 +231,20 @@
|
||||
<string name="send_comment">Kommentar absenden</string>
|
||||
<string name="all">Alle</string>
|
||||
<!-- end languages -->
|
||||
<string name="delete_history">Delete videos history</string>
|
||||
<string name="delete_history_confirm">Are you sure you want to delete all your videos history?</string>
|
||||
<string name="export_list">Export</string>
|
||||
<string name="import_list">Import</string>
|
||||
<string name="export_notification_title">Successful export!</string>
|
||||
<string name="export_notification_content">Tap here to send the export by email</string>
|
||||
<string name="export_notification_subjet">New Playlist</string>
|
||||
<string name="export_notification_body">Open the attached file with TubeLab</string>
|
||||
<string name="playback_speed">Wiedergabegeschwindigkeit</string>
|
||||
<string name="normal">Normal</string>
|
||||
<string name="delete_history">Videoverlauf löschen</string>
|
||||
<string name="delete_history_confirm">Sind Sie sicher, dass Sie den gesamten Verlauf löschen wollen?</string>
|
||||
<string name="export_list">Exportieren</string>
|
||||
<string name="import_list">Importieren</string>
|
||||
<string name="export_notification_title">Export erfolgreich!</string>
|
||||
<string name="export_notification_content">Hier tippen, um den Export per E-Mail zu senden</string>
|
||||
<string name="export_notification_subjet">Neue Wiedergabeliste</string>
|
||||
<string name="export_notification_body">Die angehängte Datei mit TubeLab öffnen</string>
|
||||
<string name="playlists">Wiedergabelisten</string>
|
||||
<string name="no_playlist">No playlists</string>
|
||||
<string name="no_playlist">Keine Wiedergabelisten</string>
|
||||
<string name="display_name">Anzeigename</string>
|
||||
<string name="action_playlist_add">Sie haben noch keine Wiedergabelisten. Klicken Sie auf das Symbol „➕”, um eine neue Wiedergabeliste hinzuzufügen.</string>
|
||||
<string name="action_playlist_add">Sie haben noch keine Wiedergabelisten. Klicken Sie auf das Symbol „➕“, um eine neue Wiedergabeliste hinzuzufügen</string>
|
||||
<string name="error_display_name">Du musst einen Anzeigenamen angeben!</string>
|
||||
<string name="error_channel_mandatory">Ein Kanal wird benötigt, wenn es sich um eine öffentliche Wiedergabeliste handelt.</string>
|
||||
<string name="action_playlist_create">Wiedergabeliste erstellen</string>
|
||||
@ -247,14 +261,14 @@
|
||||
<string name="password_indicator">Verwende mindestens 8 Zeichen</string>
|
||||
<string name="password_too_short">Das Passwort muss mindestens 8 Zeichen lang sein</string>
|
||||
<string name="username_error">Der Benutzername darf nur Buchstaben, Ziffern und Unterstriche enthalten</string>
|
||||
<string name="account_created">Account erfolgreich erstellt!</string>
|
||||
<string name="account_created_message"> Dein Account wurde erfolgreich erstellt!\n\n
|
||||
<string name="account_created">Konto erstellt!</string>
|
||||
<string name="account_created_message">Dein Konto wurde erfolgreich erstellt!\n\n
|
||||
Denke daran, deine E-Mail-Adresse innerhalb der nächsten 48 Stunden zu bestätigen.\n\n
|
||||
Du kannst nun deinen Account verbinden, indem du <b>%1$s</b> in das erste Feld schreibst und auf <b>Verbinden</b>klickst.\n\n
|
||||
<b>Wichtig</b>: Wenn deine Instanz eine Bestätigung benötigt, erhältst du eine E-Mail, sobald sie geprüft wurde!
|
||||
</string>
|
||||
<string name="account">Benutzerkonto</string>
|
||||
<string name="report_account">Account melden</string>
|
||||
<string name="report_account">Konto melden</string>
|
||||
<string-array name="settings_video_mode">
|
||||
<item>Normal</item>
|
||||
<item>WebView</item>
|
||||
@ -277,27 +291,27 @@
|
||||
<string name="agreement_check_peertube">Ich bin mindestens 16 Jahre alt und stimme den %1$s dieser Instanz zu</string>
|
||||
<string name="edit_profile">Profil bearbeiten</string>
|
||||
<string name="make_an_action">Aktion ausführen</string>
|
||||
<string name="action_unfollow">Nicht mehr folgen</string>
|
||||
<string name="action_unfollow">Abonnement abbestellen</string>
|
||||
<string name="display_nsfw_videos">Heikle Videos anzeigen</string>
|
||||
<string name="fullscreen">Vollbildmodus</string>
|
||||
<string name="bookmark_peertube_empty">Keine Videos in den Favoriten!</string>
|
||||
<string name="delete_channel">Kanal entfernen</string>
|
||||
<string name="action_channel_confirm_delete">Möchtest du diesen Kanal wirklich löschen?</string>
|
||||
<string name="modify_playlists">Video in Wiedergabelisten</string>
|
||||
<string name="no_muted">Keine stummgeschalteten Accounts!</string>
|
||||
<string name="no_muted">Keine stummgeschalteten Konten!</string>
|
||||
<string name="error_display_name_channel">Du musst einen Namen und einen Anzeigenamen für diesen Kanal definieren!</string>
|
||||
<string name="action_channel_create">Kanal erstellen</string>
|
||||
<string name="action_channel_edit">Kanal bearbeiten</string>
|
||||
<string name="email_error_domain">E-Mail-Adressen bei %1$s sind nicht erlaubt!</string>
|
||||
<string name="report_comment_size">Bitte gib einen Grund an</string>
|
||||
<string name="not_logged_in">Du musst authentifiziert sein, um diesen Vorgang auszuführen.</string>
|
||||
<string name="successful_report">Der Account wurde gemeldet!</string>
|
||||
<string name="successful_report">Das Konto wurde gemeldet!</string>
|
||||
<string name="successful_report_comment">Der Kommentar wurde gemeldet!</string>
|
||||
<string name="successful_video_report">Dieses Video wurde gemeldet!</string>
|
||||
<string name="password_length_error">Das Passwort muss mindestens 6 Zeichen lang sein!</string>
|
||||
<string name="muted_done">Der Account wurde stummgeschaltet!</string>
|
||||
<string name="muted_done">Das Konto wurde stummgeschaltet!</string>
|
||||
<string name="edit_video">Video bearbeiten</string>
|
||||
<string name="create_an_account">Account erstellen</string>
|
||||
<string name="create_an_account">Konto erstellen</string>
|
||||
<string name="followers_count">%1$s Abonnenten</string>
|
||||
<string name="developer">Entwickler</string>
|
||||
<string name="about_vesrion">Version %1$s</string>
|
||||
@ -316,8 +330,8 @@
|
||||
<string name="pickup_languages">Sprachen wählen</string>
|
||||
<string name="notification_channel_name">Information aktualisiert</string>
|
||||
<string name="fetch_notification_channel_name">Rufe Benachrichtigungen ab</string>
|
||||
<string name="add_account">Füge einen Account hinzu</string>
|
||||
<string name="list_of_accounts">Liste der Accounts</string>
|
||||
<string name="add_account">Ein Konto hinzufügen</string>
|
||||
<string name="list_of_accounts">Liste der Konten</string>
|
||||
<string name="pause">Pause</string>
|
||||
<string name="play">Abspielen</string>
|
||||
<string name="minimize">Verkleinern</string>
|
||||
|
@ -14,9 +14,11 @@
|
||||
<string name="set_autoplay_description">If enabled, videos will be played automatically</string>
|
||||
<string name="set_fullscreen">Fullscreen</string>
|
||||
<string name="set_fullscreen_description">Automatically open videos in fullscreen</string>
|
||||
<string name="set_autoplay_next_video_settings">Autoplay</string>
|
||||
<string name="set_autoplay_next_video">Automatically start playing the next video</string>
|
||||
<string name="set_autoplay_next_video_description">When a video ends, follow up with the next suggested video.</string>
|
||||
<string name="add_public_reply">Προσθήκη δημόσιας απάντησης</string>
|
||||
<string name="originally_published">Originally published</string>
|
||||
<string name="activity">Activity</string>
|
||||
<string name="app">App</string>
|
||||
<string name="notif_new_video">New video from your subscriptions</string>
|
||||
@ -80,6 +82,9 @@
|
||||
<item>6 hours</item>
|
||||
<item>12 hours</item>
|
||||
</string-array>
|
||||
<string name="_retry">Retry</string>
|
||||
<string name="refresh_token_failed">Token refresh failed!</string>
|
||||
<string name="refresh_token_failed_message">You can retry this action or simply disconnect the current account</string>
|
||||
<string name="yes">Ναι</string>
|
||||
<string name="no">Όχι</string>
|
||||
<string name="cancel">Ακύρωση</string>
|
||||
@ -118,8 +123,15 @@
|
||||
<string name="toast_error_loading_account">Παρουσιάστηκε κάποιο σφάλμα, κατά την εναλλαγή μεταξύ των λογαριασμών!</string>
|
||||
<string name="toast_error_search">Παρουσιάστηκε κάποιο σφάλμα κατά την αναζήτηση!</string>
|
||||
<string name="nothing_to_do">Δεν μπορεί να εκτελεστεί καμία ενέργεια</string>
|
||||
<string name="action_follow">Ακολούθηση</string>
|
||||
<string name="action_follow">Subscribe</string>
|
||||
<string name="action_mute">Σίγαση</string>
|
||||
<string name="unlimited">Unlimited</string>
|
||||
<string name="mb">MB</string>
|
||||
<string name="gb">GB</string>
|
||||
<string name="total_video_quota">Total video quota</string>
|
||||
<string name="daily_video_quota">Daily video quota</string>
|
||||
<string name="nsfw_title_warning">Mature or explicit content</string>
|
||||
<string name="nsfw_message_warning">This video contains mature or explicit content. Are you sure you want to watch it?</string>
|
||||
<string name="search">Αναζήτηση</string>
|
||||
<string name="delete">Διαγραφή</string>
|
||||
<string name="action_lists_confirm_delete">Είστε βέβαιοι ότι θέλετε να διαγράψετε μόνιμα αυτή τη λίστα;</string>
|
||||
@ -219,6 +231,8 @@
|
||||
<string name="send_comment">Αποστολή σχόλιου</string>
|
||||
<string name="all">Όλα</string>
|
||||
<!-- end languages -->
|
||||
<string name="playback_speed">Playback speed</string>
|
||||
<string name="normal">Normal</string>
|
||||
<string name="delete_history">Delete videos history</string>
|
||||
<string name="delete_history_confirm">Are you sure you want to delete all your videos history?</string>
|
||||
<string name="export_list">Export</string>
|
||||
@ -276,7 +290,7 @@
|
||||
<string name="agreement_check_peertube">Είμαι τουλάχιστον 16 χρονών, και συμφωνώ με %1$s αυτής της υπόστασης</string>
|
||||
<string name="edit_profile">Επεξεργασία προφίλ</string>
|
||||
<string name="make_an_action">Κάντε μια ενέργεια</string>
|
||||
<string name="action_unfollow">Διακοπή παρακολούθησης</string>
|
||||
<string name="action_unfollow">Unsubscribe</string>
|
||||
<string name="display_nsfw_videos">Εμφάνιση ευαίσθητων βίντεο</string>
|
||||
<string name="fullscreen">Πλήρης οθόνη</string>
|
||||
<string name="bookmark_peertube_empty">Δεν υπάρχουν βίντεο στα αγαπημένα σας!</string>
|
||||
|
@ -14,9 +14,11 @@
|
||||
<string name="set_autoplay_description">If enabled, videos will be played automatically</string>
|
||||
<string name="set_fullscreen">Fullscreen</string>
|
||||
<string name="set_fullscreen_description">Automatically open videos in fullscreen</string>
|
||||
<string name="set_autoplay_next_video_settings">Autoplay</string>
|
||||
<string name="set_autoplay_next_video">Automatically start playing the next video</string>
|
||||
<string name="set_autoplay_next_video_description">When a video ends, follow up with the next suggested video.</string>
|
||||
<string name="add_public_reply">Añade una respuesta pública</string>
|
||||
<string name="originally_published">Originally published</string>
|
||||
<string name="activity">Activity</string>
|
||||
<string name="app">App</string>
|
||||
<string name="notif_new_video">New video from your subscriptions</string>
|
||||
@ -80,6 +82,9 @@
|
||||
<item>6 hours</item>
|
||||
<item>12 hours</item>
|
||||
</string-array>
|
||||
<string name="_retry">Retry</string>
|
||||
<string name="refresh_token_failed">Token refresh failed!</string>
|
||||
<string name="refresh_token_failed_message">You can retry this action or simply disconnect the current account</string>
|
||||
<string name="yes">Sí</string>
|
||||
<string name="no">No</string>
|
||||
<string name="cancel">Cancelar</string>
|
||||
@ -118,8 +123,15 @@
|
||||
<string name="toast_error_loading_account">¡Ocurrió un error al cambiar de cuentas!</string>
|
||||
<string name="toast_error_search">¡Ocurrió un error durante la búsqueda!</string>
|
||||
<string name="nothing_to_do">No hay ninguna acción disponible</string>
|
||||
<string name="action_follow">Seguir</string>
|
||||
<string name="action_follow">Subscribe</string>
|
||||
<string name="action_mute">Silenciar</string>
|
||||
<string name="unlimited">Unlimited</string>
|
||||
<string name="mb">MB</string>
|
||||
<string name="gb">GB</string>
|
||||
<string name="total_video_quota">Total video quota</string>
|
||||
<string name="daily_video_quota">Daily video quota</string>
|
||||
<string name="nsfw_title_warning">Mature or explicit content</string>
|
||||
<string name="nsfw_message_warning">This video contains mature or explicit content. Are you sure you want to watch it?</string>
|
||||
<string name="search">Buscar</string>
|
||||
<string name="delete">Eliminar</string>
|
||||
<string name="action_lists_confirm_delete">¿Estás seguro de que quieres eliminar definitivamente esta lista?</string>
|
||||
@ -219,6 +231,8 @@
|
||||
<string name="send_comment">Enviar comentario</string>
|
||||
<string name="all">Todo</string>
|
||||
<!-- end languages -->
|
||||
<string name="playback_speed">Playback speed</string>
|
||||
<string name="normal">Normal</string>
|
||||
<string name="delete_history">Delete videos history</string>
|
||||
<string name="delete_history_confirm">Are you sure you want to delete all your videos history?</string>
|
||||
<string name="export_list">Export</string>
|
||||
@ -277,7 +291,7 @@
|
||||
<string name="agreement_check_peertube">Tengo por lo menos 16 años y estoy de acuerdo con los %1$s de esta instancia</string>
|
||||
<string name="edit_profile">Editar perfil</string>
|
||||
<string name="make_an_action">Haga una acción</string>
|
||||
<string name="action_unfollow">Unfollow</string>
|
||||
<string name="action_unfollow">Unsubscribe</string>
|
||||
<string name="display_nsfw_videos">Mostrar videos sensibles</string>
|
||||
<string name="fullscreen">Pantalla completa</string>
|
||||
<string name="bookmark_peertube_empty">No hay videos en tus favoritos!</string>
|
||||
|
@ -1,33 +1,35 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources xmlns:tools="http://schemas.android.com/tools">
|
||||
<string name="set_video_in_list">Videos in list</string>
|
||||
<string name="set_video_in_list_description">Change the layout for displaying videos in a list</string>
|
||||
<string name="no_instances">No instances !</string>
|
||||
<string name="show_more">Show more</string>
|
||||
<string name="show_less">Show less</string>
|
||||
<string name="set_play_screen_lock">Screen lock</string>
|
||||
<string name="set_play_screen_lock_description">Keep playing videos when the screen is locked</string>
|
||||
<string name="save">Save</string>
|
||||
<string name="enable_history">Enable history</string>
|
||||
<string name="change_profile_picture">Change profile picture</string>
|
||||
<string name="set_autoplay">Automatic playback</string>
|
||||
<string name="set_autoplay_description">If enabled, videos will be played automatically</string>
|
||||
<string name="set_fullscreen">Fullscreen</string>
|
||||
<string name="set_fullscreen_description">Automatically open videos in fullscreen</string>
|
||||
<string name="set_autoplay_next_video">Automatically start playing the next video</string>
|
||||
<string name="set_autoplay_next_video_description">When a video ends, follow up with the next suggested video.</string>
|
||||
<string name="set_video_in_list">Vidéos en liste</string>
|
||||
<string name="set_video_in_list_description">Modifier la mise en page pour afficher les vidéos dans une liste</string>
|
||||
<string name="no_instances">Aucune instance !</string>
|
||||
<string name="show_more">Afficher plus</string>
|
||||
<string name="show_less">Afficher moins</string>
|
||||
<string name="set_play_screen_lock">Verrouillage de l\'écran</string>
|
||||
<string name="set_play_screen_lock_description">Continuer à lire des vidéos quand l\'écran est verrouillé</string>
|
||||
<string name="save">Enregistrer</string>
|
||||
<string name="enable_history">Activer l\'historique</string>
|
||||
<string name="change_profile_picture">Changer la photo de profil</string>
|
||||
<string name="set_autoplay">Lecture automatique</string>
|
||||
<string name="set_autoplay_description">Si activé, les vidéos seront lues automatiquement</string>
|
||||
<string name="set_fullscreen">Plein écran</string>
|
||||
<string name="set_fullscreen_description">Ouvrir automatiquement les vidéos en plein écran</string>
|
||||
<string name="set_autoplay_next_video_settings">Lecture auto</string>
|
||||
<string name="set_autoplay_next_video">Démarrer automatiquement la lecture de la prochaine vidéo</string>
|
||||
<string name="set_autoplay_next_video_description">Quand une vidéo est finie, continuer avec la prochaine vidéo suggérée.</string>
|
||||
<string name="add_public_reply">Ajouter une réponse publique</string>
|
||||
<string name="activity">Activity</string>
|
||||
<string name="app">App</string>
|
||||
<string name="notif_new_video">New video from your subscriptions</string>
|
||||
<string name="notif_new_comment">New comment on your video</string>
|
||||
<string name="notif_blocked">One of your video is blocked/unblocked</string>
|
||||
<string name="notif_video_published">Video published (after transcoding/scheduled update)</string>
|
||||
<string name="notif_video_imported">Video import finished</string>
|
||||
<string name="notif_new_followers">You or your channel(s) has a new follower</string>
|
||||
<string name="notif_video_mention">Someone mentioned you in video comments</string>
|
||||
<string name="notif_abuse_received">An abuse report received a new message</string>
|
||||
<string name="notif_abuse_accepted">One of your abuse reports has been accepted or rejected by moderators</string>
|
||||
<string name="originally_published">Publié originalement</string>
|
||||
<string name="activity">Activité</string>
|
||||
<string name="app">Appli</string>
|
||||
<string name="notif_new_video">Nouvelle vidéo de vos abonnements</string>
|
||||
<string name="notif_new_comment">Nouveau commentaire sur votre vidéo</string>
|
||||
<string name="notif_blocked">Une de vos vidéos est bloquée/débloquée</string>
|
||||
<string name="notif_video_published">Vidéo publiée (après transcodage/mise à jour planifiée)</string>
|
||||
<string name="notif_video_imported">Importation de la vidéo terminée</string>
|
||||
<string name="notif_new_followers">Vous ou votre/vos chaîne(s) avez un nouvel abonné</string>
|
||||
<string name="notif_video_mention">Quelqu\'un vous a mentionné·e dans un commentaire</string>
|
||||
<string name="notif_abuse_received">Un rapport d\'abus a reçu un nouveau message</string>
|
||||
<string name="notif_abuse_accepted">Un de vos rapports d\'abus a été accepté ou rejeté par les modérateurs</string>
|
||||
<plurals name="number_of_replies">
|
||||
<item quantity="one">%d réponse</item>
|
||||
<item quantity="other">%d réponses</item>
|
||||
@ -60,26 +62,29 @@
|
||||
<string name="close">Fermer</string>
|
||||
<string name="upload_video">Téléverser</string>
|
||||
<string name="image_preview">Aperçu de l\'image</string>
|
||||
<string name="file_to_upload">Sélectionnez un fichier à transférer</string>
|
||||
<string name="new_video">New video</string>
|
||||
<string name="new_blacklist">New blacklist info</string>
|
||||
<string name="new_my_video_published">Your video is published</string>
|
||||
<string name="new_my_video_error">Error when publishing your video</string>
|
||||
<string name="new_comment">New comment</string>
|
||||
<string name="new_follow">New follow</string>
|
||||
<string name="file_to_upload">Sélectionnez un fichier à téléverser</string>
|
||||
<string name="new_video">Nouvelle vidéo</string>
|
||||
<string name="new_blacklist">Nouvelles infos sut la liste noire</string>
|
||||
<string name="new_my_video_published">Votre vidéo est publiée</string>
|
||||
<string name="new_my_video_error">Erreur lors de la publication de votre vidéo</string>
|
||||
<string name="new_comment">Nouveau commentaire</string>
|
||||
<string name="new_follow">Nouvel abonnement</string>
|
||||
<string name="channel">Chaîne</string>
|
||||
<string name="videos">Vidéos</string>
|
||||
<string name="channels">Chaînes</string>
|
||||
<string name="refresh_every">Fetch every:</string>
|
||||
<string name="refresh_every">Récupérer chaque :</string>
|
||||
<string-array name="refresh_time">
|
||||
<item>Never</item>
|
||||
<item>Jamais</item>
|
||||
<item>15 minutes</item>
|
||||
<item>30 minutes</item>
|
||||
<item>1 hour</item>
|
||||
<item>2 hours</item>
|
||||
<item>6 hours</item>
|
||||
<item>12 hours</item>
|
||||
<item>1 heure</item>
|
||||
<item>2 heures</item>
|
||||
<item>6 heures</item>
|
||||
<item>12 heures</item>
|
||||
</string-array>
|
||||
<string name="_retry">Retry</string>
|
||||
<string name="refresh_token_failed">Token refresh failed!</string>
|
||||
<string name="refresh_token_failed_message">You can retry this action or simply disconnect the current account</string>
|
||||
<string name="yes">Oui</string>
|
||||
<string name="no">Non</string>
|
||||
<string name="cancel">Annuler</string>
|
||||
@ -93,13 +98,13 @@
|
||||
<string name="date_day">%d j</string>
|
||||
<string name="number_view_video">%s vues</string>
|
||||
<string name="title_instance_login">Domaine de l\'instance</string>
|
||||
<string name="uploading">Transfert en cours, veuillez patienter …</string>
|
||||
<string name="upload_video_success">La vidéo a été transférée !</string>
|
||||
<string name="toast_cancelled">Transfert annulé !</string>
|
||||
<string name="video_uploaded_action">Cliquez ici pour éditer les données de la vidéo.</string>
|
||||
<string name="toot_select_image_error">Une erreur s’est produite lors de la sélection du média !</string>
|
||||
<string name="uploading">Téléversement en cours, veuillez patienter…</string>
|
||||
<string name="upload_video_success">La vidéo a été téléversée !</string>
|
||||
<string name="toast_cancelled">Téléversement annulé !</string>
|
||||
<string name="video_uploaded_action">Cliquez ici pour modifier les données de la vidéo.</string>
|
||||
<string name="toot_select_image_error">Une erreur s\'est produite lors de la sélection du média !</string>
|
||||
<string name="download_file">Télécharger %1$s</string>
|
||||
<string name="account_updated">The account has been updated!</string>
|
||||
<string name="account_updated">Le compte a été mis à jour !</string>
|
||||
<string name="action_privacy">Confidentialité</string>
|
||||
<string name="action_logout">Déconnexion</string>
|
||||
<string name="login">Connexion</string>
|
||||
@ -120,6 +125,13 @@
|
||||
<string name="nothing_to_do">Aucune action ne peut être réalisée</string>
|
||||
<string name="action_follow">S\'abonner</string>
|
||||
<string name="action_mute">Mettre en sourdine</string>
|
||||
<string name="unlimited">Illimité</string>
|
||||
<string name="mb">Mo</string>
|
||||
<string name="gb">Go</string>
|
||||
<string name="total_video_quota">Quota vidéo total</string>
|
||||
<string name="daily_video_quota">Quota vidéo quotidien</string>
|
||||
<string name="nsfw_title_warning">Contenu adulte ou vulgaire</string>
|
||||
<string name="nsfw_message_warning">Cette vidéo contient du contenu adulte ou vulgaire. Êtes-vous sûr·e de vouloir la regarder ?</string>
|
||||
<string name="search">Chercher</string>
|
||||
<string name="delete">Supprimer</string>
|
||||
<string name="action_lists_confirm_delete">Êtes-vous sûr de vouloir supprimer définitivement cette liste de lecture ?</string>
|
||||
@ -133,8 +145,8 @@
|
||||
<string name="app_logo">Logo de l’application</string>
|
||||
<!-- languages not translated -->
|
||||
<string name="subscriptions">Abonnements</string>
|
||||
<string name="delete_instance">Delete an instance</string>
|
||||
<string name="delete_instance_confirm">Are you sure to delete this instance?</string>
|
||||
<string name="delete_instance">Supprimer l\'instance</string>
|
||||
<string name="delete_instance_confirm">Êtes-vous sûr·e de vouloir supprimer cette instance ?</string>
|
||||
<string name="delete_comment">Supprimer le commentaire</string>
|
||||
<string name="delete_comment_confirm">Etes-vous sûr de vouloir supprimer ce commentaire ?</string>
|
||||
<string name="set_video_mode">Mode pour les vidéos</string>
|
||||
@ -175,7 +187,7 @@
|
||||
<string name="description">Libellé</string>
|
||||
<string name="toast_peertube_video_updated">La vidéo a été mise à jour !</string>
|
||||
<string name="register_account">Créer un compte</string>
|
||||
<string name="email_address">Adresse mèl</string>
|
||||
<string name="email_address">Adresse courriel</string>
|
||||
<string name="preview">Aperçu</string>
|
||||
<string name="change_preview">Modifier l\'aperçu</string>
|
||||
<string name="name">Nom</string>
|
||||
@ -213,22 +225,24 @@
|
||||
<string name="peertube_video_from_subscription"><![CDATA[<b>%1$s</b> a publié une nouvelle vidéo : <b>%2$s</b>]]></string>
|
||||
<string name="peertube_video_blacklist"><![CDATA[Votre vidéo <b>%1$s</b> a été blacklisté]]></string>
|
||||
<string name="peertube_video_unblacklist"><![CDATA[Votre vidéo <b>%1$s</b> n’est plus blacklisté]]></string>
|
||||
<string name="peertube_video_report_success"><![CDATA[Your abuse report <b>%1$s</b> has been accepted]]></string>
|
||||
<string name="peertube_video_report_success"><![CDATA[Votre rapport d’abus <b>%1$s</b> a été accepté]]></string>
|
||||
<string name="peertube_video_abuse"><![CDATA[Nouveau signalement pour la vidéo : <b>%1$s</b>]]></string>
|
||||
<string name="add_public_comment">Ajouter un commentaire public</string>
|
||||
<string name="send_comment">Envoyer un commentaire</string>
|
||||
<string name="all">Tout</string>
|
||||
<!-- end languages -->
|
||||
<string name="delete_history">Delete videos history</string>
|
||||
<string name="delete_history_confirm">Are you sure you want to delete all your videos history?</string>
|
||||
<string name="export_list">Export</string>
|
||||
<string name="import_list">Import</string>
|
||||
<string name="export_notification_title">Successful export!</string>
|
||||
<string name="export_notification_content">Tap here to send the export by email</string>
|
||||
<string name="export_notification_subjet">New Playlist</string>
|
||||
<string name="export_notification_body">Open the attached file with TubeLab</string>
|
||||
<string name="playback_speed">Vitesse de lecture</string>
|
||||
<string name="normal">Normale</string>
|
||||
<string name="delete_history">Supprimer l\'historique des vidéos</string>
|
||||
<string name="delete_history_confirm">Êtes-vous sûr·e de vouloir supprimer tout votre historique des vidéos ?</string>
|
||||
<string name="export_list">Exporter</string>
|
||||
<string name="import_list">Importer</string>
|
||||
<string name="export_notification_title">Exportation réussie !</string>
|
||||
<string name="export_notification_content">Appuyez ici pour envoyer l\'exportation par courriel</string>
|
||||
<string name="export_notification_subjet">Nouvelle liste de lecture</string>
|
||||
<string name="export_notification_body">Ouvrir le fichier joint avec TubeLab</string>
|
||||
<string name="playlists">Listes de lecture</string>
|
||||
<string name="no_playlist">No playlists</string>
|
||||
<string name="no_playlist">Aucune liste de lecture</string>
|
||||
<string name="display_name">Nom d\'affichage</string>
|
||||
<string name="action_playlist_add">Vous n\'avez aucune liste de lecture. Cliquez sur l\'icône « + » pour en ajouter une</string>
|
||||
<string name="error_display_name">Vous devez fournir un nom d\'affichage !</string>
|
||||
@ -242,13 +256,17 @@
|
||||
<string name="sign_up">S’inscrire</string>
|
||||
<string name="all_field_filled">Veuillez remplir tous les champs !</string>
|
||||
<string name="password_error">Les mots de passe ne sont pas identiques !</string>
|
||||
<string name="email_error">L\'e-mail ne semble pas être valide !</string>
|
||||
<string name="email_indicator">Vous recevrez un e-mail de confirmation</string>
|
||||
<string name="email_error">Le courriel ne semble pas être valide !</string>
|
||||
<string name="email_indicator">Vous recevrez un courriel de confirmation</string>
|
||||
<string name="password_indicator">Utilisez au moins 8 caractères</string>
|
||||
<string name="password_too_short">Le mot de passe doit contenir au moins 8 caractères</string>
|
||||
<string name="username_error">Le nom d\'utilisateur·rice doit être en minuscule, contenir uniquement des lettres, des chiffres, des points et des caractères de soulignement</string>
|
||||
<string name="account_created">Compte créé !</string>
|
||||
<string name="account_created_message">Votre compte est créé !\n\nVous allez recevoir un email de confirmation à l\'adresse <b>%1$s</b>.\n\nCliquez sur le lien présent dans le mail pour valider votre compte.</string>
|
||||
<string name="account_created_message"> Votre compte a été créé !\n\n
|
||||
Pensez à valider votre courriel dans les 48 heures qui suivent.\n\n
|
||||
Vous pouvez maintenant connecter votre compte en écrivant <b>%1$s</b> dans le premier champ et en appuyant sur <b>Connecter</b>.\n\n
|
||||
<b>Important</b> : si votre instance a besoin de validation, vous recevrez un courriel une qu\'elle est fois validée !
|
||||
</string>
|
||||
<string name="account">Compte</string>
|
||||
<string name="report_account">Signaler le compte</string>
|
||||
<string-array name="settings_video_mode">
|
||||
@ -284,7 +302,7 @@
|
||||
<string name="error_display_name_channel">Vous devez fournir un nom d\'affichage et un nom pour la chaîne!</string>
|
||||
<string name="action_channel_create">Créer une chaîne</string>
|
||||
<string name="action_channel_edit">Modifier une chaîne</string>
|
||||
<string name="email_error_domain">Les adresses mails %1$s ne sont pas autorisées !</string>
|
||||
<string name="email_error_domain">Les adresses courriel %1$s ne sont pas autorisées !</string>
|
||||
<string name="report_comment_size">Veuillez préciser les raisons.</string>
|
||||
<string name="not_logged_in">Vous devez être connecté.e pour effectuer cette action !</string>
|
||||
<string name="successful_report">Le compte a été signalé !</string>
|
||||
@ -311,7 +329,7 @@
|
||||
<string name="pickup_categories">Sélection des catégories</string>
|
||||
<string name="pickup_languages">Sélection des langues</string>
|
||||
<string name="notification_channel_name">Mise à jour des informations</string>
|
||||
<string name="fetch_notification_channel_name">Fetch notifications</string>
|
||||
<string name="fetch_notification_channel_name">Récupérer les notifications</string>
|
||||
<string name="add_account">Ajouter un compte</string>
|
||||
<string name="list_of_accounts">Liste des comptes</string>
|
||||
<string name="pause">Pause</string>
|
||||
|
@ -1,30 +1,32 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources xmlns:tools="http://schemas.android.com/tools">
|
||||
<string name="set_video_in_list">Videos in list</string>
|
||||
<string name="set_video_in_list_description">Change the layout for displaying videos in a list</string>
|
||||
<string name="no_instances">No instances !</string>
|
||||
<string name="show_more">Show more</string>
|
||||
<string name="show_less">Show less</string>
|
||||
<string name="set_play_screen_lock">Screen lock</string>
|
||||
<string name="set_play_screen_lock_description">Keep playing videos when the screen is locked</string>
|
||||
<string name="save">Save</string>
|
||||
<string name="enable_history">Enable history</string>
|
||||
<string name="change_profile_picture">Change profile picture</string>
|
||||
<string name="set_autoplay">Automatic playback</string>
|
||||
<string name="set_autoplay_description">If enabled, videos will be played automatically</string>
|
||||
<string name="set_fullscreen">Fullscreen</string>
|
||||
<string name="set_fullscreen_description">Automatically open videos in fullscreen</string>
|
||||
<string name="set_autoplay_next_video">Automatically start playing the next video</string>
|
||||
<string name="set_autoplay_next_video_description">When a video ends, follow up with the next suggested video.</string>
|
||||
<string name="set_video_in_list">Elenco di video</string>
|
||||
<string name="set_video_in_list_description">Cambia la disposizione per visualizzare i video in un elenco</string>
|
||||
<string name="no_instances">Nessuna istanza!</string>
|
||||
<string name="show_more">Mostra di più</string>
|
||||
<string name="show_less">Mostra meno</string>
|
||||
<string name="set_play_screen_lock">Blocco schermo</string>
|
||||
<string name="set_play_screen_lock_description">Mantieni la riproduzione dei video quando lo schermo è bloccato</string>
|
||||
<string name="save">Salva</string>
|
||||
<string name="enable_history">Abilita la cronologia</string>
|
||||
<string name="change_profile_picture">Cambia l\'immagine profilo</string>
|
||||
<string name="set_autoplay">Riproduzione automatica</string>
|
||||
<string name="set_autoplay_description">Se abilitata, i video verranno riprodotti automaticamente</string>
|
||||
<string name="set_fullscreen">Schermo intero</string>
|
||||
<string name="set_fullscreen_description">Apri automaticamente i video a schermo intero</string>
|
||||
<string name="set_autoplay_next_video_settings">Riproduzione automatica</string>
|
||||
<string name="set_autoplay_next_video">Inizia automaticamente a riprodurre il video successivo</string>
|
||||
<string name="set_autoplay_next_video_description">Quando un video finisce, continuare con il video successivo suggerito.</string>
|
||||
<string name="add_public_reply">Aggiungere una risposta pubblica</string>
|
||||
<string name="activity">Activity</string>
|
||||
<string name="app">App</string>
|
||||
<string name="notif_new_video">New video from your subscriptions</string>
|
||||
<string name="notif_new_comment">New comment on your video</string>
|
||||
<string name="notif_blocked">One of your video is blocked/unblocked</string>
|
||||
<string name="notif_video_published">Video published (after transcoding/scheduled update)</string>
|
||||
<string name="notif_video_imported">Video import finished</string>
|
||||
<string name="notif_new_followers">You or your channel(s) has a new follower</string>
|
||||
<string name="originally_published">Originariamente pubblicato</string>
|
||||
<string name="activity">Attività</string>
|
||||
<string name="app">Applicazione</string>
|
||||
<string name="notif_new_video">Nuovo video dalle tue sottoscrizioni</string>
|
||||
<string name="notif_new_comment">Nuovo commento sul tuo video</string>
|
||||
<string name="notif_blocked">Uno dei tuoi video è bloccato/sbloccato</string>
|
||||
<string name="notif_video_published">Video pubblicato (dopo la transcodifica/l\'aggiornamento programmato)</string>
|
||||
<string name="notif_video_imported">Importazione video terminata</string>
|
||||
<string name="notif_new_followers">Tu o i tuoi canali avete un nuovo abbonamento</string>
|
||||
<string name="notif_video_mention">Someone mentioned you in video comments</string>
|
||||
<string name="notif_abuse_received">An abuse report received a new message</string>
|
||||
<string name="notif_abuse_accepted">One of your abuse reports has been accepted or rejected by moderators</string>
|
||||
@ -61,25 +63,28 @@
|
||||
<string name="upload_video">Carica</string>
|
||||
<string name="image_preview">Anteprima immagine</string>
|
||||
<string name="file_to_upload">Seleziona il file da caricare</string>
|
||||
<string name="new_video">New video</string>
|
||||
<string name="new_blacklist">New blacklist info</string>
|
||||
<string name="new_my_video_published">Your video is published</string>
|
||||
<string name="new_my_video_error">Error when publishing your video</string>
|
||||
<string name="new_comment">New comment</string>
|
||||
<string name="new_follow">New follow</string>
|
||||
<string name="new_video">Nuovo video</string>
|
||||
<string name="new_blacklist">Nuove informazioni lista nera</string>
|
||||
<string name="new_my_video_published">Il tuo video è stato pubblicato</string>
|
||||
<string name="new_my_video_error">Errore durante la pubblicazione del video</string>
|
||||
<string name="new_comment">Nuovo commento</string>
|
||||
<string name="new_follow">Una nuova persona ti segue</string>
|
||||
<string name="channel">Canale</string>
|
||||
<string name="videos">Video</string>
|
||||
<string name="channels">Canali</string>
|
||||
<string name="refresh_every">Fetch every:</string>
|
||||
<string-array name="refresh_time">
|
||||
<item>Never</item>
|
||||
<item>15 minutes</item>
|
||||
<item>30 minutes</item>
|
||||
<item>1 hour</item>
|
||||
<item>2 hours</item>
|
||||
<item>6 hours</item>
|
||||
<item>12 hours</item>
|
||||
<item>Mai</item>
|
||||
<item>15 minuti</item>
|
||||
<item>30 minuti</item>
|
||||
<item>1 ora</item>
|
||||
<item>2 ore</item>
|
||||
<item>6 ore</item>
|
||||
<item>12 ore</item>
|
||||
</string-array>
|
||||
<string name="_retry">Retry</string>
|
||||
<string name="refresh_token_failed">Token refresh failed!</string>
|
||||
<string name="refresh_token_failed_message">You can retry this action or simply disconnect the current account</string>
|
||||
<string name="yes">Si</string>
|
||||
<string name="no">No</string>
|
||||
<string name="cancel">Annulla</string>
|
||||
@ -99,7 +104,7 @@
|
||||
<string name="video_uploaded_action">Premi qui per modificare i dati del video.</string>
|
||||
<string name="toot_select_image_error">Si è verificato un errore durante la selezione del archivio!</string>
|
||||
<string name="download_file">Scarica %1$s</string>
|
||||
<string name="account_updated">The account has been updated!</string>
|
||||
<string name="account_updated">L\'account è stato aggiornato!</string>
|
||||
<string name="action_privacy">Privacy</string>
|
||||
<string name="action_logout">Disconnettiti</string>
|
||||
<string name="login">Accedi</string>
|
||||
@ -111,15 +116,22 @@
|
||||
<string name="shared_via">Condiviso tramite TubeLab</string>
|
||||
<string name="username">Nome utente</string>
|
||||
<string name="settings">Impostazioni</string>
|
||||
<string name="logout_account_confirmation">Sei sicuro di voler fare il logout @%1$s@%2$s?</string>
|
||||
<string name="logout_account_confirmation">Sei sicuro/a di voler uscire di @%1$s@%2$s?</string>
|
||||
<string name="following">Seguendo</string>
|
||||
<string name="followers">Seguaci</string>
|
||||
<string name="client_error">Impossibile ottenere il client id!</string>
|
||||
<string name="toast_error_loading_account">Si è verificato un errore durante il cambio tra gli account!</string>
|
||||
<string name="toast_error_search">Si è verificato un errore durante la ricerca!</string>
|
||||
<string name="nothing_to_do">Nessuna azione può essere intrapresa</string>
|
||||
<string name="action_follow">Segui</string>
|
||||
<string name="action_follow">Iscriviti</string>
|
||||
<string name="action_mute">Silenzia</string>
|
||||
<string name="unlimited">Illimitato</string>
|
||||
<string name="mb">MB</string>
|
||||
<string name="gb">GB</string>
|
||||
<string name="total_video_quota">Total video quota</string>
|
||||
<string name="daily_video_quota">Daily video quota</string>
|
||||
<string name="nsfw_title_warning">Mature or explicit content</string>
|
||||
<string name="nsfw_message_warning">This video contains mature or explicit content. Are you sure you want to watch it?</string>
|
||||
<string name="search">Cerca</string>
|
||||
<string name="delete">Elimina</string>
|
||||
<string name="action_lists_confirm_delete">Sei sicuro di voler eliminare definitivamente questa lista?</string>
|
||||
@ -133,7 +145,7 @@
|
||||
<string name="app_logo">Logo dell\'applicazione</string>
|
||||
<!-- languages not translated -->
|
||||
<string name="subscriptions">Abbonamenti</string>
|
||||
<string name="delete_instance">Delete an instance</string>
|
||||
<string name="delete_instance">Elimina un\'istanza</string>
|
||||
<string name="delete_instance_confirm">Are you sure to delete this instance?</string>
|
||||
<string name="delete_comment">Elimina il commento</string>
|
||||
<string name="delete_comment_confirm">Sei sicuro di voler eliminare questo commento?</string>
|
||||
@ -219,16 +231,18 @@
|
||||
<string name="send_comment">Invia commento</string>
|
||||
<string name="all">Tutto</string>
|
||||
<!-- end languages -->
|
||||
<string name="playback_speed">Playback speed</string>
|
||||
<string name="normal">Normale</string>
|
||||
<string name="delete_history">Delete videos history</string>
|
||||
<string name="delete_history_confirm">Are you sure you want to delete all your videos history?</string>
|
||||
<string name="export_list">Export</string>
|
||||
<string name="import_list">Import</string>
|
||||
<string name="export_notification_title">Successful export!</string>
|
||||
<string name="export_notification_content">Tap here to send the export by email</string>
|
||||
<string name="export_notification_subjet">New Playlist</string>
|
||||
<string name="export_notification_subjet">Nuova playlist</string>
|
||||
<string name="export_notification_body">Open the attached file with TubeLab</string>
|
||||
<string name="playlists">Playlist</string>
|
||||
<string name="no_playlist">No playlists</string>
|
||||
<string name="no_playlist">Nessuna playlist</string>
|
||||
<string name="display_name">Nome visualizzato</string>
|
||||
<string name="action_playlist_add">Non hai nessuna playlist. Premi l\'icona \"+\" per aggiungere una nuova playlist</string>
|
||||
<string name="error_display_name">È necessario fornire un nome da visualizzare!</string>
|
||||
@ -277,7 +291,7 @@
|
||||
<string name="agreement_check_peertube">Ho almeno 16 anni e accetto le %1$s di questa istanza</string>
|
||||
<string name="edit_profile">Modifica profilo</string>
|
||||
<string name="make_an_action">Scegli un\'azione</string>
|
||||
<string name="action_unfollow">Smetti di seguire</string>
|
||||
<string name="action_unfollow">Unsubscribe</string>
|
||||
<string name="display_nsfw_videos">Mostra video sensibili</string>
|
||||
<string name="fullscreen">A tutto schermo</string>
|
||||
<string name="bookmark_peertube_empty">Non c\'è nessun video nei tuoi favoriti!</string>
|
||||
|
@ -14,9 +14,11 @@
|
||||
<string name="set_autoplay_description">If enabled, videos will be played automatically</string>
|
||||
<string name="set_fullscreen">Fullscreen</string>
|
||||
<string name="set_fullscreen_description">Automatically open videos in fullscreen</string>
|
||||
<string name="set_autoplay_next_video_settings">Autoplay</string>
|
||||
<string name="set_autoplay_next_video">Automatically start playing the next video</string>
|
||||
<string name="set_autoplay_next_video_description">When a video ends, follow up with the next suggested video.</string>
|
||||
<string name="add_public_reply">Add a public reply</string>
|
||||
<string name="originally_published">Originally published</string>
|
||||
<string name="activity">Activity</string>
|
||||
<string name="app">App</string>
|
||||
<string name="notif_new_video">New video from your subscriptions</string>
|
||||
@ -79,6 +81,9 @@
|
||||
<item>6 hours</item>
|
||||
<item>12 hours</item>
|
||||
</string-array>
|
||||
<string name="_retry">Retry</string>
|
||||
<string name="refresh_token_failed">Token refresh failed!</string>
|
||||
<string name="refresh_token_failed_message">You can retry this action or simply disconnect the current account</string>
|
||||
<string name="yes">はい</string>
|
||||
<string name="no">いいえ</string>
|
||||
<string name="cancel">キャンセル</string>
|
||||
@ -117,8 +122,15 @@
|
||||
<string name="toast_error_loading_account">アカウントの切り替え中にエラーが発生しました!</string>
|
||||
<string name="toast_error_search">検索中にエラーが発生しました!</string>
|
||||
<string name="nothing_to_do">何もすることはできません</string>
|
||||
<string name="action_follow">フォローする</string>
|
||||
<string name="action_follow">Subscribe</string>
|
||||
<string name="action_mute">ミュート</string>
|
||||
<string name="unlimited">Unlimited</string>
|
||||
<string name="mb">MB</string>
|
||||
<string name="gb">GB</string>
|
||||
<string name="total_video_quota">Total video quota</string>
|
||||
<string name="daily_video_quota">Daily video quota</string>
|
||||
<string name="nsfw_title_warning">Mature or explicit content</string>
|
||||
<string name="nsfw_message_warning">This video contains mature or explicit content. Are you sure you want to watch it?</string>
|
||||
<string name="search">検索</string>
|
||||
<string name="delete">削除</string>
|
||||
<string name="action_lists_confirm_delete">このリストを完全に削除してもよろしいですか?</string>
|
||||
@ -218,6 +230,8 @@
|
||||
<string name="send_comment">コメントを送信</string>
|
||||
<string name="all">すべて</string>
|
||||
<!-- end languages -->
|
||||
<string name="playback_speed">Playback speed</string>
|
||||
<string name="normal">Normal</string>
|
||||
<string name="delete_history">Delete videos history</string>
|
||||
<string name="delete_history_confirm">Are you sure you want to delete all your videos history?</string>
|
||||
<string name="export_list">Export</string>
|
||||
@ -276,7 +290,7 @@
|
||||
<string name="agreement_check_peertube">私は16歳以上で、インスタンスの %1$s に同意します。</string>
|
||||
<string name="edit_profile">プロフィールを編集</string>
|
||||
<string name="make_an_action">アクションを作成</string>
|
||||
<string name="action_unfollow">フォロー解除</string>
|
||||
<string name="action_unfollow">Unsubscribe</string>
|
||||
<string name="display_nsfw_videos">Display sensitive videos</string>
|
||||
<string name="fullscreen">Fullscreen</string>
|
||||
<string name="bookmark_peertube_empty">There are no videos in your favourites!</string>
|
||||
|
@ -14,9 +14,11 @@
|
||||
<string name="set_autoplay_description">If enabled, videos will be played automatically</string>
|
||||
<string name="set_fullscreen">Fullscreen</string>
|
||||
<string name="set_fullscreen_description">Automatically open videos in fullscreen</string>
|
||||
<string name="set_autoplay_next_video_settings">Autoplay</string>
|
||||
<string name="set_autoplay_next_video">Automatically start playing the next video</string>
|
||||
<string name="set_autoplay_next_video_description">When a video ends, follow up with the next suggested video.</string>
|
||||
<string name="add_public_reply">Add a public reply</string>
|
||||
<string name="originally_published">Originally published</string>
|
||||
<string name="activity">Activity</string>
|
||||
<string name="app">App</string>
|
||||
<string name="notif_new_video">New video from your subscriptions</string>
|
||||
@ -79,6 +81,9 @@
|
||||
<item>6 hours</item>
|
||||
<item>12 hours</item>
|
||||
</string-array>
|
||||
<string name="_retry">Retry</string>
|
||||
<string name="refresh_token_failed">Token refresh failed!</string>
|
||||
<string name="refresh_token_failed_message">You can retry this action or simply disconnect the current account</string>
|
||||
<string name="yes">예</string>
|
||||
<string name="no">아니</string>
|
||||
<string name="cancel">취소</string>
|
||||
@ -117,8 +122,15 @@
|
||||
<string name="toast_error_loading_account">An error occurred while switching between accounts!</string>
|
||||
<string name="toast_error_search">An error occurred while searching!</string>
|
||||
<string name="nothing_to_do">아무 조치를 취할 수 없습니다</string>
|
||||
<string name="action_follow">팔로우</string>
|
||||
<string name="action_follow">Subscribe</string>
|
||||
<string name="action_mute">뮤트</string>
|
||||
<string name="unlimited">Unlimited</string>
|
||||
<string name="mb">MB</string>
|
||||
<string name="gb">GB</string>
|
||||
<string name="total_video_quota">Total video quota</string>
|
||||
<string name="daily_video_quota">Daily video quota</string>
|
||||
<string name="nsfw_title_warning">Mature or explicit content</string>
|
||||
<string name="nsfw_message_warning">This video contains mature or explicit content. Are you sure you want to watch it?</string>
|
||||
<string name="search">검색</string>
|
||||
<string name="delete">삭제</string>
|
||||
<string name="action_lists_confirm_delete">이 리스트를 정말로 영원히 삭제하시겠습니까?</string>
|
||||
@ -218,6 +230,8 @@
|
||||
<string name="send_comment">댓글 보내기</string>
|
||||
<string name="all">모두</string>
|
||||
<!-- end languages -->
|
||||
<string name="playback_speed">Playback speed</string>
|
||||
<string name="normal">Normal</string>
|
||||
<string name="delete_history">Delete videos history</string>
|
||||
<string name="delete_history_confirm">Are you sure you want to delete all your videos history?</string>
|
||||
<string name="export_list">Export</string>
|
||||
@ -276,7 +290,7 @@
|
||||
<string name="agreement_check_peertube">I am at least 16 years old and agree to the %1$s of this instance</string>
|
||||
<string name="edit_profile">프로필 수정</string>
|
||||
<string name="make_an_action">Make an action</string>
|
||||
<string name="action_unfollow">언팔로우</string>
|
||||
<string name="action_unfollow">Unsubscribe</string>
|
||||
<string name="display_nsfw_videos">Display sensitive videos</string>
|
||||
<string name="fullscreen">Fullscreen</string>
|
||||
<string name="bookmark_peertube_empty">There are no videos in your favourites!</string>
|
||||
|
@ -14,9 +14,11 @@
|
||||
<string name="set_autoplay_description">Als deze optie is ingeschakeld, worden de video\'s automatisch afgespeeld</string>
|
||||
<string name="set_fullscreen">Volledig scherm</string>
|
||||
<string name="set_fullscreen_description">Video\'s automatisch openen op volledig scherm</string>
|
||||
<string name="set_autoplay_next_video_settings">Autoplay</string>
|
||||
<string name="set_autoplay_next_video">De volgende video automatisch afspelen</string>
|
||||
<string name="set_autoplay_next_video_description">Wanneer een video eindigt, begin dan met de volgende voorgestelde video.</string>
|
||||
<string name="add_public_reply">Voeg een openbaar antwoord toe</string>
|
||||
<string name="originally_published">Originally published</string>
|
||||
<string name="activity">Activiteit</string>
|
||||
<string name="app">App</string>
|
||||
<string name="notif_new_video">Nieuwe video uit uw abonnementen</string>
|
||||
@ -80,6 +82,9 @@
|
||||
<item>6 uren</item>
|
||||
<item>12 uren</item>
|
||||
</string-array>
|
||||
<string name="_retry">Retry</string>
|
||||
<string name="refresh_token_failed">Token refresh failed!</string>
|
||||
<string name="refresh_token_failed_message">You can retry this action or simply disconnect the current account</string>
|
||||
<string name="yes">Ja</string>
|
||||
<string name="no">Geen</string>
|
||||
<string name="cancel">Annuleren</string>
|
||||
@ -118,8 +123,15 @@
|
||||
<string name="toast_error_loading_account">Er is een fout opgetreden bij het wisselen tussen de accounts!</string>
|
||||
<string name="toast_error_search">Er is een fout opgetreden tijdens het zoeken!</string>
|
||||
<string name="nothing_to_do">Er kan geen actie worden ondernomen</string>
|
||||
<string name="action_follow">Volg</string>
|
||||
<string name="action_follow">Subscribe</string>
|
||||
<string name="action_mute">Stomme</string>
|
||||
<string name="unlimited">Unlimited</string>
|
||||
<string name="mb">MB</string>
|
||||
<string name="gb">GB</string>
|
||||
<string name="total_video_quota">Total video quota</string>
|
||||
<string name="daily_video_quota">Daily video quota</string>
|
||||
<string name="nsfw_title_warning">Mature or explicit content</string>
|
||||
<string name="nsfw_message_warning">This video contains mature or explicit content. Are you sure you want to watch it?</string>
|
||||
<string name="search">Zoek</string>
|
||||
<string name="delete">Verwijder</string>
|
||||
<string name="action_lists_confirm_delete">Weet u zeker dat u deze lijst permanent wilt verwijderen?</string>
|
||||
@ -219,6 +231,8 @@
|
||||
<string name="send_comment">Reactie versturen</string>
|
||||
<string name="all">Allemaal</string>
|
||||
<!-- end languages -->
|
||||
<string name="playback_speed">Playback speed</string>
|
||||
<string name="normal">Normal</string>
|
||||
<string name="delete_history">Delete videos history</string>
|
||||
<string name="delete_history_confirm">Are you sure you want to delete all your videos history?</string>
|
||||
<string name="export_list">Exporteren</string>
|
||||
@ -277,7 +291,7 @@
|
||||
<string name="agreement_check_peertube">Ik ben minstens 16 jaar oud en ga akkoord met de %1$s van dit geval</string>
|
||||
<string name="edit_profile">Profiel bewerken</string>
|
||||
<string name="make_an_action">Maak een actie</string>
|
||||
<string name="action_unfollow">Ontvouw</string>
|
||||
<string name="action_unfollow">Unsubscribe</string>
|
||||
<string name="display_nsfw_videos">Gevoelige video\'s weergeven</string>
|
||||
<string name="fullscreen">Volledig scherm</string>
|
||||
<string name="bookmark_peertube_empty">Er zijn geen video\'s in uw favorieten!</string>
|
||||
|
@ -14,9 +14,11 @@
|
||||
<string name="set_autoplay_description">Jeśli włączone, filmy będą odtwarzane automatycznie</string>
|
||||
<string name="set_fullscreen">Pełny ekran</string>
|
||||
<string name="set_fullscreen_description">Automatycznie otwieraj filmy w trybie pełnoekranowym</string>
|
||||
<string name="set_autoplay_next_video_settings">Autoodtwarzanie</string>
|
||||
<string name="set_autoplay_next_video">Automatycznie rozpocznij odtwarzanie następnego filmu</string>
|
||||
<string name="set_autoplay_next_video_description">Kiedy film się skończy, odtwórz następny sugerowany film.</string>
|
||||
<string name="add_public_reply">Dodaj publiczną odpowiedź</string>
|
||||
<string name="originally_published">Oryginalnie opublikowane</string>
|
||||
<string name="activity">Aktywność</string>
|
||||
<string name="app">Aplikacja</string>
|
||||
<string name="notif_new_video">Nowy film z twoich subskrypcji</string>
|
||||
@ -82,6 +84,9 @@
|
||||
<item>6 godzin</item>
|
||||
<item>12 godzin</item>
|
||||
</string-array>
|
||||
<string name="_retry">Retry</string>
|
||||
<string name="refresh_token_failed">Token refresh failed!</string>
|
||||
<string name="refresh_token_failed_message">You can retry this action or simply disconnect the current account</string>
|
||||
<string name="yes">Tak</string>
|
||||
<string name="no">Nie</string>
|
||||
<string name="cancel">Anuluj</string>
|
||||
@ -120,8 +125,15 @@
|
||||
<string name="toast_error_loading_account">Wystąpił błąd podczas przełączania konta!</string>
|
||||
<string name="toast_error_search">Podczas wyszukiwania wystąpił błąd!</string>
|
||||
<string name="nothing_to_do">Nie można podjąć żadnych działań</string>
|
||||
<string name="action_follow">Obserwuj</string>
|
||||
<string name="action_follow">Subskrybuj</string>
|
||||
<string name="action_mute">Wycisz</string>
|
||||
<string name="unlimited">Bez ograniczeń</string>
|
||||
<string name="mb">MB</string>
|
||||
<string name="gb">GB</string>
|
||||
<string name="total_video_quota">Całkowity limit filmów</string>
|
||||
<string name="daily_video_quota">Dzienny limit filmów</string>
|
||||
<string name="nsfw_title_warning">Dojrzała lub jawna zawartość</string>
|
||||
<string name="nsfw_message_warning">Ten film zawiera treści dojrzałe lub jawne. Czy na pewno chcesz go obejrzeć?</string>
|
||||
<string name="search">Szukaj</string>
|
||||
<string name="delete">Usuń</string>
|
||||
<string name="action_lists_confirm_delete">Czy na pewno chcesz na stałe usunąć tę listę?</string>
|
||||
@ -221,8 +233,10 @@
|
||||
<string name="send_comment">Prześlij komentarz</string>
|
||||
<string name="all">Wszystkie</string>
|
||||
<!-- end languages -->
|
||||
<string name="delete_history">Delete videos history</string>
|
||||
<string name="delete_history_confirm">Are you sure you want to delete all your videos history?</string>
|
||||
<string name="playback_speed">Szybkość odtwarzania</string>
|
||||
<string name="normal">Normalny</string>
|
||||
<string name="delete_history">Wyczyść historię</string>
|
||||
<string name="delete_history_confirm">Czy na pewno chcesz usunąć całą historię filmów?</string>
|
||||
<string name="export_list">Eksportuj</string>
|
||||
<string name="import_list">Importuj</string>
|
||||
<string name="export_notification_title">Eksport zakończony sukcesem!</string>
|
||||
@ -279,7 +293,7 @@
|
||||
<string name="agreement_check_peertube">Mam co najmniej 16 lat i zgadzam się na %1$s w tym przypadku</string>
|
||||
<string name="edit_profile">Profil edycyjny</string>
|
||||
<string name="make_an_action">Podejmij działania</string>
|
||||
<string name="action_unfollow">Rozwiń</string>
|
||||
<string name="action_unfollow">Anuluj subskrypcję</string>
|
||||
<string name="display_nsfw_videos">Wyświetlanie wrażliwych filmów wideo</string>
|
||||
<string name="fullscreen">Fullscreen</string>
|
||||
<string name="bookmark_peertube_empty">Nie ma żadnych filmów w twoich ulubionych!</string>
|
||||
|
@ -14,9 +14,11 @@
|
||||
<string name="set_autoplay_description">If enabled, videos will be played automatically</string>
|
||||
<string name="set_fullscreen">Fullscreen</string>
|
||||
<string name="set_fullscreen_description">Automatically open videos in fullscreen</string>
|
||||
<string name="set_autoplay_next_video_settings">Autoplay</string>
|
||||
<string name="set_autoplay_next_video">Automatically start playing the next video</string>
|
||||
<string name="set_autoplay_next_video_description">When a video ends, follow up with the next suggested video.</string>
|
||||
<string name="add_public_reply">Add a public reply</string>
|
||||
<string name="originally_published">Originally published</string>
|
||||
<string name="activity">Activity</string>
|
||||
<string name="app">App</string>
|
||||
<string name="notif_new_video">New video from your subscriptions</string>
|
||||
@ -80,6 +82,9 @@
|
||||
<item>6 hours</item>
|
||||
<item>12 hours</item>
|
||||
</string-array>
|
||||
<string name="_retry">Retry</string>
|
||||
<string name="refresh_token_failed">Token refresh failed!</string>
|
||||
<string name="refresh_token_failed_message">You can retry this action or simply disconnect the current account</string>
|
||||
<string name="yes">Sim</string>
|
||||
<string name="no">Não</string>
|
||||
<string name="cancel">Cancelar</string>
|
||||
@ -118,8 +123,15 @@
|
||||
<string name="toast_error_loading_account">Ocorreu um erro ao alternar entre as contas!</string>
|
||||
<string name="toast_error_search">Ocorreu um erro na pesquisa!</string>
|
||||
<string name="nothing_to_do">A ação não pode ser feita ou não é suportada</string>
|
||||
<string name="action_follow">Seguir</string>
|
||||
<string name="action_follow">Subscribe</string>
|
||||
<string name="action_mute">Silenciar</string>
|
||||
<string name="unlimited">Unlimited</string>
|
||||
<string name="mb">MB</string>
|
||||
<string name="gb">GB</string>
|
||||
<string name="total_video_quota">Total video quota</string>
|
||||
<string name="daily_video_quota">Daily video quota</string>
|
||||
<string name="nsfw_title_warning">Mature or explicit content</string>
|
||||
<string name="nsfw_message_warning">This video contains mature or explicit content. Are you sure you want to watch it?</string>
|
||||
<string name="search">Pesquisa</string>
|
||||
<string name="delete">Remover</string>
|
||||
<string name="action_lists_confirm_delete">Tem certeza de que deseja excluir permanentemente esta lista?</string>
|
||||
@ -219,6 +231,8 @@
|
||||
<string name="send_comment">Enviar comentário</string>
|
||||
<string name="all">Tudo</string>
|
||||
<!-- end languages -->
|
||||
<string name="playback_speed">Playback speed</string>
|
||||
<string name="normal">Normal</string>
|
||||
<string name="delete_history">Delete videos history</string>
|
||||
<string name="delete_history_confirm">Are you sure you want to delete all your videos history?</string>
|
||||
<string name="export_list">Export</string>
|
||||
@ -277,7 +291,7 @@
|
||||
<string name="agreement_check_peertube">I am at least 16 years old and agree to the %1$s of this instance</string>
|
||||
<string name="edit_profile">Editar perfil</string>
|
||||
<string name="make_an_action">Make an action</string>
|
||||
<string name="action_unfollow">Deixar de seguir</string>
|
||||
<string name="action_unfollow">Unsubscribe</string>
|
||||
<string name="display_nsfw_videos">Display sensitive videos</string>
|
||||
<string name="fullscreen">Fullscreen</string>
|
||||
<string name="bookmark_peertube_empty">There are no videos in your favourites!</string>
|
||||
|
@ -14,9 +14,11 @@
|
||||
<string name="set_autoplay_description">If enabled, videos will be played automatically</string>
|
||||
<string name="set_fullscreen">Fullscreen</string>
|
||||
<string name="set_fullscreen_description">Automatically open videos in fullscreen</string>
|
||||
<string name="set_autoplay_next_video_settings">Autoplay</string>
|
||||
<string name="set_autoplay_next_video">Automatically start playing the next video</string>
|
||||
<string name="set_autoplay_next_video_description">When a video ends, follow up with the next suggested video.</string>
|
||||
<string name="add_public_reply">Add a public reply</string>
|
||||
<string name="originally_published">Originally published</string>
|
||||
<string name="activity">Activity</string>
|
||||
<string name="app">App</string>
|
||||
<string name="notif_new_video">New video from your subscriptions</string>
|
||||
@ -81,6 +83,9 @@
|
||||
<item>6 hours</item>
|
||||
<item>12 hours</item>
|
||||
</string-array>
|
||||
<string name="_retry">Retry</string>
|
||||
<string name="refresh_token_failed">Token refresh failed!</string>
|
||||
<string name="refresh_token_failed_message">You can retry this action or simply disconnect the current account</string>
|
||||
<string name="yes">Da</string>
|
||||
<string name="no">Nu</string>
|
||||
<string name="cancel">Anulare</string>
|
||||
@ -119,8 +124,15 @@
|
||||
<string name="toast_error_loading_account">A apărut o eroare în timp ce schimbați între conturi!</string>
|
||||
<string name="toast_error_search">S-a produs o eroare în timpul căutării!</string>
|
||||
<string name="nothing_to_do">Nu se poate efectua nici o acțiune</string>
|
||||
<string name="action_follow">Urmărește</string>
|
||||
<string name="action_follow">Subscribe</string>
|
||||
<string name="action_mute">Mod silențios</string>
|
||||
<string name="unlimited">Unlimited</string>
|
||||
<string name="mb">MB</string>
|
||||
<string name="gb">GB</string>
|
||||
<string name="total_video_quota">Total video quota</string>
|
||||
<string name="daily_video_quota">Daily video quota</string>
|
||||
<string name="nsfw_title_warning">Mature or explicit content</string>
|
||||
<string name="nsfw_message_warning">This video contains mature or explicit content. Are you sure you want to watch it?</string>
|
||||
<string name="search">Căutare</string>
|
||||
<string name="delete">Șterge</string>
|
||||
<string name="action_lists_confirm_delete">Are you sure you want to permanently delete this list?</string>
|
||||
@ -220,6 +232,8 @@
|
||||
<string name="send_comment">Send comment</string>
|
||||
<string name="all">All</string>
|
||||
<!-- end languages -->
|
||||
<string name="playback_speed">Playback speed</string>
|
||||
<string name="normal">Normal</string>
|
||||
<string name="delete_history">Delete videos history</string>
|
||||
<string name="delete_history_confirm">Are you sure you want to delete all your videos history?</string>
|
||||
<string name="export_list">Export</string>
|
||||
@ -278,7 +292,7 @@
|
||||
<string name="agreement_check_peertube">I am at least 16 years old and agree to the %1$s of this instance</string>
|
||||
<string name="edit_profile">Editează profilul</string>
|
||||
<string name="make_an_action">Make an action</string>
|
||||
<string name="action_unfollow">Nu mai urmări</string>
|
||||
<string name="action_unfollow">Unsubscribe</string>
|
||||
<string name="display_nsfw_videos">Display sensitive videos</string>
|
||||
<string name="fullscreen">Fullscreen</string>
|
||||
<string name="bookmark_peertube_empty">There are no videos in your favourites!</string>
|
||||
|
@ -14,9 +14,11 @@
|
||||
<string name="set_autoplay_description">Если включено, видео будут воспроизводиться автоматически</string>
|
||||
<string name="set_fullscreen">Полноэкранный режим</string>
|
||||
<string name="set_fullscreen_description">Автоматически открывать видео в полноэкранном режиме</string>
|
||||
<string name="set_autoplay_next_video_settings">Autoplay</string>
|
||||
<string name="set_autoplay_next_video">Автоматически начать воспроизведение следующего видео</string>
|
||||
<string name="set_autoplay_next_video_description">Когда видео заканчивается, перейдите к следующему предложенному видео.</string>
|
||||
<string name="add_public_reply">Добавить публичный ответ</string>
|
||||
<string name="originally_published">Originally published</string>
|
||||
<string name="activity">Действия</string>
|
||||
<string name="app">Приложение</string>
|
||||
<string name="notif_new_video">Новое видео из ваших подписок</string>
|
||||
@ -82,6 +84,9 @@
|
||||
<item>6 часов</item>
|
||||
<item>12 часов</item>
|
||||
</string-array>
|
||||
<string name="_retry">Retry</string>
|
||||
<string name="refresh_token_failed">Token refresh failed!</string>
|
||||
<string name="refresh_token_failed_message">You can retry this action or simply disconnect the current account</string>
|
||||
<string name="yes">Да</string>
|
||||
<string name="no">Нет</string>
|
||||
<string name="cancel">Отмена</string>
|
||||
@ -120,8 +125,15 @@
|
||||
<string name="toast_error_loading_account">Произошла ошибка при переключении между аккаунтами!</string>
|
||||
<string name="toast_error_search">Произошла ошибка при поиске!</string>
|
||||
<string name="nothing_to_do">Ничего нельзя сделать</string>
|
||||
<string name="action_follow">Подписаться</string>
|
||||
<string name="action_follow">Subscribe</string>
|
||||
<string name="action_mute">Игнорировать</string>
|
||||
<string name="unlimited">Unlimited</string>
|
||||
<string name="mb">MB</string>
|
||||
<string name="gb">GB</string>
|
||||
<string name="total_video_quota">Total video quota</string>
|
||||
<string name="daily_video_quota">Daily video quota</string>
|
||||
<string name="nsfw_title_warning">Mature or explicit content</string>
|
||||
<string name="nsfw_message_warning">This video contains mature or explicit content. Are you sure you want to watch it?</string>
|
||||
<string name="search">Поиск</string>
|
||||
<string name="delete">Удалить</string>
|
||||
<string name="action_lists_confirm_delete">Вы действительно хотите удалить этот список навсегда?</string>
|
||||
@ -221,6 +233,8 @@
|
||||
<string name="send_comment">Оставить комментарий</string>
|
||||
<string name="all">Все</string>
|
||||
<!-- end languages -->
|
||||
<string name="playback_speed">Playback speed</string>
|
||||
<string name="normal">Normal</string>
|
||||
<string name="delete_history">Delete videos history</string>
|
||||
<string name="delete_history_confirm">Are you sure you want to delete all your videos history?</string>
|
||||
<string name="export_list">Export</string>
|
||||
@ -279,7 +293,7 @@
|
||||
<string name="agreement_check_peertube">Мне 16 или более лет и я согласен с %1$s этого экземпляра</string>
|
||||
<string name="edit_profile">Редактировать профиль</string>
|
||||
<string name="make_an_action">Предпринять действие</string>
|
||||
<string name="action_unfollow">Отписаться</string>
|
||||
<string name="action_unfollow">Unsubscribe</string>
|
||||
<string name="display_nsfw_videos">Показывать неприличные видео</string>
|
||||
<string name="fullscreen">На полный экран</string>
|
||||
<string name="bookmark_peertube_empty">В избранном нет видео!</string>
|
||||
|
@ -14,9 +14,11 @@
|
||||
<string name="set_autoplay_description">If enabled, videos will be played automatically</string>
|
||||
<string name="set_fullscreen">Fullscreen</string>
|
||||
<string name="set_fullscreen_description">Automatically open videos in fullscreen</string>
|
||||
<string name="set_autoplay_next_video_settings">Autoplay</string>
|
||||
<string name="set_autoplay_next_video">Automatically start playing the next video</string>
|
||||
<string name="set_autoplay_next_video_description">When a video ends, follow up with the next suggested video.</string>
|
||||
<string name="add_public_reply">Add a public reply</string>
|
||||
<string name="originally_published">Originally published</string>
|
||||
<string name="activity">Activity</string>
|
||||
<string name="app">App</string>
|
||||
<string name="notif_new_video">New video from your subscriptions</string>
|
||||
@ -80,6 +82,9 @@
|
||||
<item>6 hours</item>
|
||||
<item>12 hours</item>
|
||||
</string-array>
|
||||
<string name="_retry">Retry</string>
|
||||
<string name="refresh_token_failed">Token refresh failed!</string>
|
||||
<string name="refresh_token_failed_message">You can retry this action or simply disconnect the current account</string>
|
||||
<string name="yes">Ja</string>
|
||||
<string name="no">Nej</string>
|
||||
<string name="cancel">Avbryt</string>
|
||||
@ -118,8 +123,15 @@
|
||||
<string name="toast_error_loading_account">Ett fel uppstod vid växling mellan konton!</string>
|
||||
<string name="toast_error_search">Ett fel uppstod under sökningen!</string>
|
||||
<string name="nothing_to_do">Inga åtgärder kan vidtas</string>
|
||||
<string name="action_follow">Följ</string>
|
||||
<string name="action_follow">Subscribe</string>
|
||||
<string name="action_mute">Tysta</string>
|
||||
<string name="unlimited">Unlimited</string>
|
||||
<string name="mb">MB</string>
|
||||
<string name="gb">GB</string>
|
||||
<string name="total_video_quota">Total video quota</string>
|
||||
<string name="daily_video_quota">Daily video quota</string>
|
||||
<string name="nsfw_title_warning">Mature or explicit content</string>
|
||||
<string name="nsfw_message_warning">This video contains mature or explicit content. Are you sure you want to watch it?</string>
|
||||
<string name="search">Sök</string>
|
||||
<string name="delete">Ta bort</string>
|
||||
<string name="action_lists_confirm_delete">Är du säker du vill ta bort listan permanent?</string>
|
||||
@ -219,6 +231,8 @@
|
||||
<string name="send_comment">Skicka kommentar</string>
|
||||
<string name="all">Allt</string>
|
||||
<!-- end languages -->
|
||||
<string name="playback_speed">Playback speed</string>
|
||||
<string name="normal">Normal</string>
|
||||
<string name="delete_history">Delete videos history</string>
|
||||
<string name="delete_history_confirm">Are you sure you want to delete all your videos history?</string>
|
||||
<string name="export_list">Export</string>
|
||||
@ -277,7 +291,7 @@
|
||||
<string name="agreement_check_peertube">Jag är minst 16 år gammal och godkänner %1$s för denna instans</string>
|
||||
<string name="edit_profile">Ändra profil</string>
|
||||
<string name="make_an_action">Gör en handling</string>
|
||||
<string name="action_unfollow">Sluta följa</string>
|
||||
<string name="action_unfollow">Unsubscribe</string>
|
||||
<string name="display_nsfw_videos">Display sensitive videos</string>
|
||||
<string name="fullscreen">Fullscreen</string>
|
||||
<string name="bookmark_peertube_empty">There are no videos in your favourites!</string>
|
||||
|
@ -14,9 +14,11 @@
|
||||
<string name="set_autoplay_description">If enabled, videos will be played automatically</string>
|
||||
<string name="set_fullscreen">Fullscreen</string>
|
||||
<string name="set_fullscreen_description">Automatically open videos in fullscreen</string>
|
||||
<string name="set_autoplay_next_video_settings">Autoplay</string>
|
||||
<string name="set_autoplay_next_video">Automatically start playing the next video</string>
|
||||
<string name="set_autoplay_next_video_description">When a video ends, follow up with the next suggested video.</string>
|
||||
<string name="add_public_reply">添加公开回复</string>
|
||||
<string name="originally_published">Originally published</string>
|
||||
<string name="activity">Activity</string>
|
||||
<string name="app">App</string>
|
||||
<string name="notif_new_video">New video from your subscriptions</string>
|
||||
@ -79,6 +81,9 @@
|
||||
<item>6 hours</item>
|
||||
<item>12 hours</item>
|
||||
</string-array>
|
||||
<string name="_retry">Retry</string>
|
||||
<string name="refresh_token_failed">Token refresh failed!</string>
|
||||
<string name="refresh_token_failed_message">You can retry this action or simply disconnect the current account</string>
|
||||
<string name="yes">是</string>
|
||||
<string name="no">否</string>
|
||||
<string name="cancel">取消</string>
|
||||
@ -117,8 +122,15 @@
|
||||
<string name="toast_error_loading_account">在切换帐户时出现了错误!</string>
|
||||
<string name="toast_error_search">搜索时出现了错误!</string>
|
||||
<string name="nothing_to_do">无法进行任何操作</string>
|
||||
<string name="action_follow">订阅</string>
|
||||
<string name="action_follow">Subscribe</string>
|
||||
<string name="action_mute">静音</string>
|
||||
<string name="unlimited">Unlimited</string>
|
||||
<string name="mb">MB</string>
|
||||
<string name="gb">GB</string>
|
||||
<string name="total_video_quota">Total video quota</string>
|
||||
<string name="daily_video_quota">Daily video quota</string>
|
||||
<string name="nsfw_title_warning">Mature or explicit content</string>
|
||||
<string name="nsfw_message_warning">This video contains mature or explicit content. Are you sure you want to watch it?</string>
|
||||
<string name="search">搜索</string>
|
||||
<string name="delete">删除</string>
|
||||
<string name="action_lists_confirm_delete">您确定要永久删除此列表吗?</string>
|
||||
@ -218,6 +230,8 @@
|
||||
<string name="send_comment">发送评论</string>
|
||||
<string name="all">全部</string>
|
||||
<!-- end languages -->
|
||||
<string name="playback_speed">Playback speed</string>
|
||||
<string name="normal">Normal</string>
|
||||
<string name="delete_history">Delete videos history</string>
|
||||
<string name="delete_history_confirm">Are you sure you want to delete all your videos history?</string>
|
||||
<string name="export_list">Export</string>
|
||||
@ -275,7 +289,7 @@
|
||||
<string name="agreement_check_peertube">我已至少年满十六岁,并且同意该实例的 %1$s</string>
|
||||
<string name="edit_profile">编辑个人资料</string>
|
||||
<string name="make_an_action">请选择其中一项操作</string>
|
||||
<string name="action_unfollow">取消订阅</string>
|
||||
<string name="action_unfollow">Unsubscribe</string>
|
||||
<string name="display_nsfw_videos">显示敏感视频</string>
|
||||
<string name="fullscreen">全屏</string>
|
||||
<string name="bookmark_peertube_empty">您的收藏列表为空!</string>
|
||||
|
@ -14,9 +14,11 @@
|
||||
<string name="set_autoplay_description">If enabled, videos will be played automatically</string>
|
||||
<string name="set_fullscreen">Fullscreen</string>
|
||||
<string name="set_fullscreen_description">Automatically open videos in fullscreen</string>
|
||||
<string name="set_autoplay_next_video_settings">Autoplay</string>
|
||||
<string name="set_autoplay_next_video">Automatically start playing the next video</string>
|
||||
<string name="set_autoplay_next_video_description">When a video ends, follow up with the next suggested video.</string>
|
||||
<string name="add_public_reply">Add a public reply</string>
|
||||
<string name="originally_published">Originally published</string>
|
||||
<string name="activity">Activity</string>
|
||||
<string name="app">App</string>
|
||||
<string name="notif_new_video">New video from your subscriptions</string>
|
||||
@ -79,6 +81,9 @@
|
||||
<item>6 hours</item>
|
||||
<item>12 hours</item>
|
||||
</string-array>
|
||||
<string name="_retry">Retry</string>
|
||||
<string name="refresh_token_failed">Token refresh failed!</string>
|
||||
<string name="refresh_token_failed_message">You can retry this action or simply disconnect the current account</string>
|
||||
<string name="yes">是</string>
|
||||
<string name="no">否</string>
|
||||
<string name="cancel">取消</string>
|
||||
@ -117,8 +122,15 @@
|
||||
<string name="toast_error_loading_account">在帳號間切換時發生錯誤!</string>
|
||||
<string name="toast_error_search">搜尋時發生錯誤!</string>
|
||||
<string name="nothing_to_do">無法採取行動</string>
|
||||
<string name="action_follow">關注</string>
|
||||
<string name="action_follow">Subscribe</string>
|
||||
<string name="action_mute">靜音</string>
|
||||
<string name="unlimited">Unlimited</string>
|
||||
<string name="mb">MB</string>
|
||||
<string name="gb">GB</string>
|
||||
<string name="total_video_quota">Total video quota</string>
|
||||
<string name="daily_video_quota">Daily video quota</string>
|
||||
<string name="nsfw_title_warning">Mature or explicit content</string>
|
||||
<string name="nsfw_message_warning">This video contains mature or explicit content. Are you sure you want to watch it?</string>
|
||||
<string name="search">搜尋</string>
|
||||
<string name="delete">刪除</string>
|
||||
<string name="action_lists_confirm_delete">您確定您想要永久刪除此列表嗎?</string>
|
||||
@ -218,6 +230,8 @@
|
||||
<string name="send_comment">傳送留言</string>
|
||||
<string name="all">全部</string>
|
||||
<!-- end languages -->
|
||||
<string name="playback_speed">Playback speed</string>
|
||||
<string name="normal">Normal</string>
|
||||
<string name="delete_history">Delete videos history</string>
|
||||
<string name="delete_history_confirm">Are you sure you want to delete all your videos history?</string>
|
||||
<string name="export_list">Export</string>
|
||||
@ -276,7 +290,7 @@
|
||||
<string name="agreement_check_peertube">我至少 16 歲並同意此站台的 %1$s</string>
|
||||
<string name="edit_profile">編輯個人資料</string>
|
||||
<string name="make_an_action">做動作</string>
|
||||
<string name="action_unfollow">取消追蹤</string>
|
||||
<string name="action_unfollow">Unsubscribe</string>
|
||||
<string name="display_nsfw_videos">Display sensitive videos</string>
|
||||
<string name="fullscreen">Fullscreen</string>
|
||||
<string name="bookmark_peertube_empty">There are no videos in your favourites!</string>
|
||||
|
@ -7,6 +7,7 @@
|
||||
<color name="tag_color_text">#FAFAFA</color>
|
||||
<color name="positive_thumbs">#2b90d9</color>
|
||||
<color name="negative_thumbs">#F44336</color>
|
||||
|
||||
<color name="backgroundDark">#DD000000</color>
|
||||
<color name="red_1">#F44336</color>
|
||||
<color name="gray_light">#80808080</color>
|
||||
</resources>
|
@ -31,10 +31,12 @@
|
||||
|
||||
<string name="set_fullscreen">Fullscreen</string>
|
||||
<string name="set_fullscreen_description">Automatically open videos in fullscreen</string>
|
||||
<string name="set_autoplay_next_video_settings">Autoplay</string>
|
||||
<string name="set_autoplay_next_video">Automatically start playing the next video</string>
|
||||
<string name="set_autoplay_next_video_description">When a video ends, follow up with the next suggested video.</string>
|
||||
<string name="add_public_reply">Add a public reply</string>
|
||||
|
||||
<string name="originally_published">Originally published</string>
|
||||
<string name="activity">Activity</string>
|
||||
<string name="app">App</string>
|
||||
<string name="notif_new_video">New video from your subscriptions</string>
|
||||
@ -103,6 +105,9 @@
|
||||
<item>12 hours</item>
|
||||
</string-array>
|
||||
|
||||
<string name="_retry">Retry</string>
|
||||
<string name="refresh_token_failed">Token refresh failed!</string>
|
||||
<string name="refresh_token_failed_message">You can retry this action or simply disconnect the current account</string>
|
||||
<string name="yes">Yes</string>
|
||||
<string name="no">No</string>
|
||||
<string name="cancel">Cancel</string>
|
||||
@ -154,10 +159,18 @@
|
||||
<string name="nothing_to_do">No action can be taken</string>
|
||||
|
||||
|
||||
<string name="action_follow">Follow</string>
|
||||
<string name="action_follow">Subscribe</string>
|
||||
|
||||
<string name="action_mute">Mute</string>
|
||||
|
||||
<string name="unlimited">Unlimited</string>
|
||||
<string name="mb">MB</string>
|
||||
<string name="gb">GB</string>
|
||||
<string name="total_video_quota">Total video quota</string>
|
||||
<string name="daily_video_quota">Daily video quota</string>
|
||||
|
||||
<string name="nsfw_title_warning">Mature or explicit content</string>
|
||||
<string name="nsfw_message_warning">This video contains mature or explicit content. Are you sure you want to watch it?</string>
|
||||
<string name="search">Search</string>
|
||||
<string name="delete">Delete</string>
|
||||
|
||||
@ -282,8 +295,8 @@
|
||||
<string name="send_comment">Send comment</string>
|
||||
<string name="all">All</string>
|
||||
<!-- end languages -->
|
||||
|
||||
|
||||
<string name="playback_speed">Playback speed</string>
|
||||
<string name="normal">Normal</string>
|
||||
<string name="delete_history">Delete videos history</string>
|
||||
<string name="delete_history_confirm">Are you sure you want to delete all your videos history?</string>
|
||||
|
||||
@ -355,7 +368,7 @@
|
||||
<string name="make_an_action">Make an action</string>
|
||||
|
||||
|
||||
<string name="action_unfollow">Unfollow</string>
|
||||
<string name="action_unfollow">Unsubscribe</string>
|
||||
|
||||
<string name="display_nsfw_videos">Display sensitive videos</string>
|
||||
<string name="fullscreen">Fullscreen</string>
|
||||
|
@ -157,13 +157,6 @@
|
||||
<service
|
||||
android:name=".services.RetrieveInfoService"
|
||||
android:exported="false" />
|
||||
<receiver
|
||||
android:name=".services.PeertubeUploadReceiver"
|
||||
android:exported="false">
|
||||
<intent-filter>
|
||||
<action android:name="app.fedilab.fedilabtube.uploadservice.broadcast.status" />
|
||||
</intent-filter>
|
||||
</receiver>
|
||||
|
||||
<provider
|
||||
android:name="androidx.work.impl.WorkManagerInitializer"
|
||||
|
@ -14,7 +14,12 @@ package app.fedilab.fedilabtube;
|
||||
* 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.Manifest;
|
||||
import android.app.Activity;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.content.pm.PackageManager;
|
||||
import android.net.Uri;
|
||||
import android.os.Bundle;
|
||||
import android.os.Handler;
|
||||
import android.os.Looper;
|
||||
@ -27,19 +32,19 @@ import android.view.inputmethod.InputMethodManager;
|
||||
import android.widget.AdapterView;
|
||||
import android.widget.ArrayAdapter;
|
||||
import android.widget.Button;
|
||||
import android.widget.EditText;
|
||||
import android.widget.LinearLayout;
|
||||
import android.widget.RelativeLayout;
|
||||
import android.widget.Spinner;
|
||||
import android.widget.Toast;
|
||||
|
||||
import androidx.appcompat.app.AlertDialog;
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
import androidx.core.app.ActivityCompat;
|
||||
import androidx.core.content.ContextCompat;
|
||||
import androidx.lifecycle.ViewModelProvider;
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.google.android.material.floatingactionbutton.FloatingActionButton;
|
||||
import com.bumptech.glide.Glide;
|
||||
import com.bumptech.glide.load.resource.bitmap.CenterCrop;
|
||||
import com.bumptech.glide.load.resource.bitmap.RoundedCorners;
|
||||
import com.bumptech.glide.request.RequestOptions;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
@ -54,52 +59,53 @@ import app.fedilab.fedilabtube.client.data.ChannelData;
|
||||
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.databinding.ActivityAllPlaylistBinding;
|
||||
import app.fedilab.fedilabtube.databinding.AddPlaylistBinding;
|
||||
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 app.fedilab.fedilabtube.MainActivity.peertubeInformation;
|
||||
import static app.fedilab.fedilabtube.PeertubeUploadActivity.MY_PERMISSIONS_REQUEST_READ_EXTERNAL_STORAGE;
|
||||
import static app.fedilab.fedilabtube.helper.Helper.peertubeInformation;
|
||||
|
||||
|
||||
public class AllPlaylistsActivity extends AppCompatActivity implements PlaylistAdapter.AllPlaylistRemoved {
|
||||
|
||||
|
||||
PlaylistAdapter playlistAdapter;
|
||||
private RelativeLayout mainLoader;
|
||||
private RelativeLayout textviewNoAction;
|
||||
private HashMap<Integer, String> privacyToSend;
|
||||
private Spinner set_upload_channel;
|
||||
private Spinner set_upload_privacy;
|
||||
private String idChannel;
|
||||
private List<Playlist> playlists;
|
||||
private Playlist playlistToEdit;
|
||||
private List<ChannelData.Channel> myChannels;
|
||||
private ChannelData.Channel selectedChannel;
|
||||
private static final int PICK_AVATAR = 467;
|
||||
private AddPlaylistBinding bindingDialog;
|
||||
private Uri inputData;
|
||||
private ActivityAllPlaylistBinding binding;
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
|
||||
setContentView(R.layout.activity_all_playlist);
|
||||
binding = ActivityAllPlaylistBinding.inflate(getLayoutInflater());
|
||||
View viewRoot = binding.getRoot();
|
||||
setContentView(viewRoot);
|
||||
|
||||
if (getSupportActionBar() != null)
|
||||
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
|
||||
setTitle(R.string.playlists);
|
||||
|
||||
|
||||
textviewNoAction = findViewById(R.id.no_action);
|
||||
mainLoader = findViewById(R.id.loader);
|
||||
RelativeLayout nextElementLoader = findViewById(R.id.loading_next_items);
|
||||
mainLoader.setVisibility(View.VISIBLE);
|
||||
nextElementLoader.setVisibility(View.GONE);
|
||||
binding.loader.setVisibility(View.VISIBLE);
|
||||
binding.loadingNextItems.setVisibility(View.GONE);
|
||||
idChannel = null;
|
||||
|
||||
PlaylistsVM viewModel = new ViewModelProvider(AllPlaylistsActivity.this).get(PlaylistsVM.class);
|
||||
viewModel.manage(PlaylistsVM.action.GET_PLAYLISTS, null, null).observe(AllPlaylistsActivity.this, apiResponse -> manageVIewPlaylists(PlaylistsVM.action.GET_PLAYLISTS, apiResponse));
|
||||
|
||||
FloatingActionButton add_new = findViewById(R.id.add_new);
|
||||
|
||||
|
||||
LinkedHashMap<Integer, String> privaciesInit = new LinkedHashMap<>(peertubeInformation.getPrivacies());
|
||||
if (privaciesInit.size() > 0) {
|
||||
@ -110,13 +116,12 @@ public class AllPlaylistsActivity extends AppCompatActivity implements PlaylistA
|
||||
|
||||
|
||||
playlists = new ArrayList<>();
|
||||
RecyclerView lv_playlist = findViewById(R.id.lv_playlist);
|
||||
playlistAdapter = new PlaylistAdapter(playlists, false);
|
||||
playlistAdapter.allPlaylistRemoved = this;
|
||||
lv_playlist.setAdapter(playlistAdapter);
|
||||
binding.lvPlaylist.setAdapter(playlistAdapter);
|
||||
LinearLayoutManager mLayoutManager = new LinearLayoutManager(AllPlaylistsActivity.this);
|
||||
lv_playlist.setLayoutManager(mLayoutManager);
|
||||
add_new.setOnClickListener(view -> manageAlert(null));
|
||||
binding.lvPlaylist.setLayoutManager(mLayoutManager);
|
||||
binding.addNew.setOnClickListener(view -> manageAlert(null));
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -135,7 +140,7 @@ public class AllPlaylistsActivity extends AppCompatActivity implements PlaylistA
|
||||
|
||||
|
||||
public void manageVIewPlaylists(PlaylistsVM.action actionType, APIResponse apiResponse) {
|
||||
mainLoader.setVisibility(View.GONE);
|
||||
binding.loader.setVisibility(View.GONE);
|
||||
if (apiResponse.getError() != null) {
|
||||
Toasty.error(AllPlaylistsActivity.this, apiResponse.getError().getError(), Toast.LENGTH_LONG).show();
|
||||
return;
|
||||
@ -144,9 +149,9 @@ public class AllPlaylistsActivity extends AppCompatActivity implements PlaylistA
|
||||
if (apiResponse.getPlaylists() != null && apiResponse.getPlaylists().size() > 0) {
|
||||
playlists.addAll(apiResponse.getPlaylists());
|
||||
playlistAdapter.notifyDataSetChanged();
|
||||
textviewNoAction.setVisibility(View.GONE);
|
||||
binding.noAction.setVisibility(View.GONE);
|
||||
} else {
|
||||
textviewNoAction.setVisibility(View.VISIBLE);
|
||||
binding.noAction.setVisibility(View.VISIBLE);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -155,37 +160,53 @@ public class AllPlaylistsActivity extends AppCompatActivity implements PlaylistA
|
||||
|
||||
playlistToEdit = playlistParam;
|
||||
AlertDialog.Builder dialogBuilder = new AlertDialog.Builder(AllPlaylistsActivity.this);
|
||||
LayoutInflater inflater1 = getLayoutInflater();
|
||||
View dialogView = inflater1.inflate(R.layout.add_playlist, new LinearLayout(AllPlaylistsActivity.this), false);
|
||||
dialogBuilder.setView(dialogView);
|
||||
EditText display_name = dialogView.findViewById(R.id.display_name);
|
||||
EditText description = dialogView.findViewById(R.id.description);
|
||||
set_upload_channel = dialogView.findViewById(R.id.set_upload_channel);
|
||||
set_upload_privacy = dialogView.findViewById(R.id.set_upload_privacy);
|
||||
bindingDialog = AddPlaylistBinding.inflate(LayoutInflater.from(AllPlaylistsActivity.this), null, false);
|
||||
dialogBuilder.setView(bindingDialog.getRoot());
|
||||
|
||||
dialogBuilder.setView(bindingDialog.getRoot());
|
||||
|
||||
|
||||
ChannelsVM viewModelC = new ViewModelProvider(AllPlaylistsActivity.this).get(ChannelsVM.class);
|
||||
viewModelC.get(RetrofitPeertubeAPI.DataType.MY_CHANNELS, null).observe(AllPlaylistsActivity.this, this::manageVIewChannels);
|
||||
|
||||
display_name.setFilters(new InputFilter[]{new InputFilter.LengthFilter(120)});
|
||||
description.setFilters(new InputFilter[]{new InputFilter.LengthFilter(1000)});
|
||||
bindingDialog.displayName.setFilters(new InputFilter[]{new InputFilter.LengthFilter(120)});
|
||||
bindingDialog.description.setFilters(new InputFilter[]{new InputFilter.LengthFilter(1000)});
|
||||
|
||||
if (playlistToEdit != null) {
|
||||
display_name.setText(playlistToEdit.getDisplayName());
|
||||
description.setText(playlistToEdit.getDescription());
|
||||
bindingDialog.displayName.setText(playlistToEdit.getDisplayName());
|
||||
bindingDialog.description.setText(playlistToEdit.getDescription());
|
||||
}
|
||||
dialogBuilder.setPositiveButton(R.string.validate, null);
|
||||
dialogBuilder.setNegativeButton(R.string.cancel, (dialog, id) -> dialog.dismiss());
|
||||
|
||||
AlertDialog alertDialog = dialogBuilder.create();
|
||||
|
||||
bindingDialog.selectFile.setOnClickListener(v -> {
|
||||
if (ContextCompat.checkSelfPermission(AllPlaylistsActivity.this, Manifest.permission.READ_EXTERNAL_STORAGE) !=
|
||||
PackageManager.PERMISSION_GRANTED) {
|
||||
ActivityCompat.requestPermissions(AllPlaylistsActivity.this,
|
||||
new String[]{Manifest.permission.READ_EXTERNAL_STORAGE},
|
||||
MY_PERMISSIONS_REQUEST_READ_EXTERNAL_STORAGE);
|
||||
return;
|
||||
}
|
||||
|
||||
Intent intent = new Intent(Intent.ACTION_GET_CONTENT);
|
||||
intent.addCategory(Intent.CATEGORY_OPENABLE);
|
||||
intent.setType("*/*");
|
||||
String[] mimetypes = {"image/*"};
|
||||
intent.putExtra(Intent.EXTRA_MIME_TYPES, mimetypes);
|
||||
startActivityForResult(intent, PICK_AVATAR);
|
||||
});
|
||||
Helper.loadGiF(AllPlaylistsActivity.this, playlistParam.getThumbnailPath(), bindingDialog.profilePicture);
|
||||
alertDialog.setOnShowListener(dialogInterface -> {
|
||||
|
||||
Button button = alertDialog.getButton(AlertDialog.BUTTON_POSITIVE);
|
||||
button.setOnClickListener(view -> {
|
||||
if (display_name.getText() != null && display_name.getText().toString().trim().length() > 0) {
|
||||
if (bindingDialog.displayName.getText() != null && bindingDialog.displayName.getText().toString().trim().length() > 0) {
|
||||
PlaylistParams playlistElement = new PlaylistParams();
|
||||
playlistElement.setDisplayName(display_name.getText().toString().trim());
|
||||
if (description.getText() != null && description.getText().toString().trim().length() > 0) {
|
||||
playlistElement.setDescription(description.getText().toString().trim());
|
||||
playlistElement.setDisplayName(bindingDialog.displayName.getText().toString().trim());
|
||||
if (bindingDialog.description.getText() != null && bindingDialog.description.getText().toString().trim().length() > 0) {
|
||||
playlistElement.setDescription(bindingDialog.description.getText().toString().trim());
|
||||
}
|
||||
playlistElement.setVideoChannelId(idChannel);
|
||||
String label;
|
||||
@ -203,11 +224,11 @@ public class AllPlaylistsActivity extends AppCompatActivity implements PlaylistA
|
||||
new Thread(() -> {
|
||||
String playlistId;
|
||||
if (playlistToEdit == null) {
|
||||
APIResponse apiResponse = new RetrofitPeertubeAPI(AllPlaylistsActivity.this).createOrUpdatePlaylist(PlaylistsVM.action.CREATE_PLAYLIST, null, playlistElement, null);
|
||||
APIResponse apiResponse = new RetrofitPeertubeAPI(AllPlaylistsActivity.this).createOrUpdatePlaylist(PlaylistsVM.action.CREATE_PLAYLIST, null, playlistElement, inputData);
|
||||
playlistId = apiResponse.getActionReturn();
|
||||
} else {
|
||||
playlistId = playlistToEdit.getId();
|
||||
new RetrofitPeertubeAPI(AllPlaylistsActivity.this).createOrUpdatePlaylist(PlaylistsVM.action.UPDATE_PLAYLIST, playlistId, playlistElement, null);
|
||||
new RetrofitPeertubeAPI(AllPlaylistsActivity.this).createOrUpdatePlaylist(PlaylistsVM.action.UPDATE_PLAYLIST, playlistId, playlistElement, inputData);
|
||||
}
|
||||
Handler mainHandler = new Handler(Looper.getMainLooper());
|
||||
Runnable myRunnable = () -> {
|
||||
@ -247,7 +268,7 @@ public class AllPlaylistsActivity extends AppCompatActivity implements PlaylistA
|
||||
//Hide keyboard
|
||||
InputMethodManager imm = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE);
|
||||
assert imm != null;
|
||||
imm.hideSoftInputFromWindow(display_name.getWindowToken(), 0);
|
||||
imm.hideSoftInputFromWindow(bindingDialog.displayName.getWindowToken(), 0);
|
||||
});
|
||||
if (alertDialog.getWindow() != null)
|
||||
alertDialog.getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_VISIBLE);
|
||||
@ -255,6 +276,24 @@ public class AllPlaylistsActivity extends AppCompatActivity implements PlaylistA
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void onActivityResult(int requestCode, int resultCode, Intent data) {
|
||||
super.onActivityResult(requestCode, resultCode, data);
|
||||
if (requestCode == PICK_AVATAR && resultCode == Activity.RESULT_OK) {
|
||||
if (data == null || data.getData() == null) {
|
||||
Toasty.error(AllPlaylistsActivity.this, getString(R.string.toot_select_image_error), Toast.LENGTH_LONG).show();
|
||||
return;
|
||||
}
|
||||
inputData = data.getData();
|
||||
Glide.with(AllPlaylistsActivity.this)
|
||||
.load(inputData)
|
||||
.thumbnail(0.1f)
|
||||
.apply(new RequestOptions().transform(new CenterCrop(), new RoundedCorners(10)))
|
||||
.into(bindingDialog.profilePicture);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
public void manageVIewChannels(APIResponse apiResponse) {
|
||||
if (apiResponse.getError() != null || apiResponse.getChannels() == null || apiResponse.getChannels().size() == 0) {
|
||||
if (apiResponse.getError() != null && apiResponse.getError().getError() != null)
|
||||
@ -280,7 +319,7 @@ public class AllPlaylistsActivity extends AppCompatActivity implements PlaylistA
|
||||
|
||||
ArrayAdapter<String> adapterChannel = new ArrayAdapter<>(AllPlaylistsActivity.this,
|
||||
android.R.layout.simple_spinner_dropdown_item, channelName);
|
||||
set_upload_channel.setAdapter(adapterChannel);
|
||||
bindingDialog.setUploadChannel.setAdapter(adapterChannel);
|
||||
|
||||
|
||||
LinkedHashMap<String, String> translations = null;
|
||||
@ -308,19 +347,19 @@ public class AllPlaylistsActivity extends AppCompatActivity implements PlaylistA
|
||||
|
||||
ArrayAdapter<String> adapterPrivacies = new ArrayAdapter<>(AllPlaylistsActivity.this,
|
||||
android.R.layout.simple_spinner_dropdown_item, privaciesA);
|
||||
set_upload_privacy.setAdapter(adapterPrivacies);
|
||||
bindingDialog.setUploadPrivacy.setAdapter(adapterPrivacies);
|
||||
|
||||
if (playlistToEdit != null) {
|
||||
Item privacy = playlistToEdit.getPrivacy();
|
||||
if (privacy.getId() > 0) {
|
||||
set_upload_privacy.setSelection(privacy.getId() - 1);
|
||||
bindingDialog.setUploadPrivacy.setSelection(privacy.getId() - 1);
|
||||
}
|
||||
} else {
|
||||
set_upload_privacy.setSelection(2);
|
||||
bindingDialog.setUploadPrivacy.setSelection(2);
|
||||
}
|
||||
|
||||
//Manage privacies
|
||||
set_upload_privacy.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
|
||||
bindingDialog.setUploadPrivacy.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
|
||||
@Override
|
||||
public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {
|
||||
LinkedHashMap<Integer, String> privaciesCheck = new LinkedHashMap<>(peertubeInformation.getPrivacies());
|
||||
@ -348,12 +387,12 @@ public class AllPlaylistsActivity extends AppCompatActivity implements PlaylistA
|
||||
Item privacy = playlistToEdit.getPrivacy();
|
||||
|
||||
if (privacy.getId() > 0) {
|
||||
set_upload_privacy.setSelection(privacy.getId() - 1);
|
||||
bindingDialog.setUploadPrivacy.setSelection(privacy.getId() - 1);
|
||||
}
|
||||
}
|
||||
|
||||
//Manage languages
|
||||
set_upload_channel.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
|
||||
bindingDialog.setUploadChannel.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
|
||||
@Override
|
||||
public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {
|
||||
idChannel = channelId[position];
|
||||
@ -378,12 +417,12 @@ public class AllPlaylistsActivity extends AppCompatActivity implements PlaylistA
|
||||
}
|
||||
k++;
|
||||
}
|
||||
set_upload_channel.setSelection(position);
|
||||
bindingDialog.setUploadChannel.setSelection(position);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onAllPlaylistRemoved() {
|
||||
textviewNoAction.setVisibility(View.VISIBLE);
|
||||
binding.noAction.setVisibility(View.VISIBLE);
|
||||
}
|
||||
}
|
||||
|
@ -14,22 +14,30 @@ package app.fedilab.fedilabtube;
|
||||
* 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.NotificationChannel;
|
||||
import android.app.NotificationManager;
|
||||
import android.content.Context;
|
||||
import android.content.SharedPreferences;
|
||||
import android.os.Build;
|
||||
|
||||
import androidx.multidex.MultiDex;
|
||||
import androidx.multidex.MultiDexApplication;
|
||||
import androidx.work.Configuration;
|
||||
import androidx.work.WorkManager;
|
||||
|
||||
import net.gotev.uploadservice.UploadService;
|
||||
import net.gotev.uploadservice.UploadServiceConfig;
|
||||
import net.gotev.uploadservice.observer.request.GlobalRequestObserver;
|
||||
|
||||
import java.util.Objects;
|
||||
|
||||
import app.fedilab.fedilabtube.helper.Helper;
|
||||
import app.fedilab.fedilabtube.helper.ThemeHelper;
|
||||
import app.fedilab.fedilabtube.services.GlobalUploadObserver;
|
||||
import app.fedilab.fedilabtube.worker.WorkHelper;
|
||||
|
||||
public class FedilabTube extends MultiDexApplication {
|
||||
|
||||
static String UPLOAD_CHANNEL_ID = "upload_info_peertube";
|
||||
|
||||
@Override
|
||||
public void onCreate() {
|
||||
@ -44,6 +52,10 @@ public class FedilabTube extends MultiDexApplication {
|
||||
if (interval >= 15) {
|
||||
WorkHelper.fetchNotifications(this, interval);
|
||||
}
|
||||
createNotificationChannel();
|
||||
UploadServiceConfig.initialize(FedilabTube.this, UPLOAD_CHANNEL_ID, true);
|
||||
|
||||
new GlobalRequestObserver(this, new GlobalUploadObserver());
|
||||
}
|
||||
|
||||
|
||||
@ -52,8 +64,6 @@ public class FedilabTube extends MultiDexApplication {
|
||||
super.attachBaseContext(base);
|
||||
|
||||
MultiDex.install(FedilabTube.this);
|
||||
|
||||
UploadService.NAMESPACE = BuildConfig.APPLICATION_ID;
|
||||
SharedPreferences sharedpreferences = getSharedPreferences(Helper.APP_PREFS, Context.MODE_PRIVATE);
|
||||
int themePref = sharedpreferences.getInt(Helper.SET_THEME, Helper.DEFAULT_MODE);
|
||||
ThemeHelper.switchTo(themePref);
|
||||
@ -61,5 +71,13 @@ public class FedilabTube extends MultiDexApplication {
|
||||
|
||||
}
|
||||
|
||||
|
||||
private void createNotificationChannel() {
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
|
||||
NotificationChannel channel = new NotificationChannel(UPLOAD_CHANNEL_ID,
|
||||
getString(R.string.notification_channel_name),
|
||||
NotificationManager.IMPORTANCE_LOW);
|
||||
channel.setSound(null, null);
|
||||
((NotificationManager) Objects.requireNonNull(getSystemService(Context.NOTIFICATION_SERVICE))).createNotificationChannel(channel);
|
||||
}
|
||||
}
|
||||
}
|
@ -48,7 +48,7 @@ import app.fedilab.fedilabtube.helper.RoundedBackgroundSpan;
|
||||
import app.fedilab.fedilabtube.viewmodel.InstancesVM;
|
||||
import es.dmoral.toasty.Toasty;
|
||||
|
||||
import static app.fedilab.fedilabtube.MainActivity.peertubeInformation;
|
||||
import static app.fedilab.fedilabtube.helper.Helper.peertubeInformation;
|
||||
|
||||
|
||||
public class InstancePickerActivity extends AppCompatActivity {
|
||||
|
@ -149,6 +149,14 @@ public class LoginActivity extends AppCompatActivity {
|
||||
} catch (MalformedURLException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
} else if (instance.endsWith("/")) {
|
||||
try {
|
||||
URL url = new URL("https://" + instance);
|
||||
instance = url.getHost();
|
||||
host = instance;
|
||||
} catch (MalformedURLException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
if (!Patterns.WEB_URL.matcher("https://" + instance).matches()) {
|
||||
Toasty.error(LoginActivity.this, getString(R.string.not_valide_instance)).show();
|
||||
|
@ -39,6 +39,9 @@ import androidx.appcompat.widget.SearchView;
|
||||
import androidx.appcompat.widget.Toolbar;
|
||||
import androidx.fragment.app.Fragment;
|
||||
import androidx.fragment.app.FragmentManager;
|
||||
import androidx.fragment.app.FragmentStatePagerAdapter;
|
||||
import androidx.viewpager.widget.PagerAdapter;
|
||||
import androidx.viewpager.widget.ViewPager;
|
||||
|
||||
import com.google.android.material.bottomnavigation.BottomNavigationView;
|
||||
import com.kobakei.ratethisapp.RateThisApp;
|
||||
@ -62,6 +65,7 @@ import app.fedilab.fedilabtube.client.entities.Token;
|
||||
import app.fedilab.fedilabtube.client.entities.UserMe;
|
||||
import app.fedilab.fedilabtube.client.entities.UserSettings;
|
||||
import app.fedilab.fedilabtube.client.entities.WellKnownNodeinfo;
|
||||
import app.fedilab.fedilabtube.databinding.ActivityMainBinding;
|
||||
import app.fedilab.fedilabtube.fragment.DisplayOverviewFragment;
|
||||
import app.fedilab.fedilabtube.fragment.DisplayVideosFragment;
|
||||
import app.fedilab.fedilabtube.helper.Helper;
|
||||
@ -77,52 +81,19 @@ import es.dmoral.toasty.Toasty;
|
||||
import static app.fedilab.fedilabtube.MainActivity.TypeOfConnection.NORMAL;
|
||||
import static app.fedilab.fedilabtube.MainActivity.TypeOfConnection.SURFING;
|
||||
import static app.fedilab.fedilabtube.helper.Helper.academies;
|
||||
import static app.fedilab.fedilabtube.helper.Helper.peertubeInformation;
|
||||
|
||||
public class MainActivity extends AppCompatActivity {
|
||||
|
||||
public static PeertubeInformation peertubeInformation;
|
||||
|
||||
public static int PICK_INSTANCE = 5641;
|
||||
public static int PICK_INSTANCE_SURF = 5642;
|
||||
public static UserMe userMe;
|
||||
public static InstanceData.InstanceConfig instanceConfig;
|
||||
public static TypeOfConnection typeOfConnection;
|
||||
final FragmentManager fm = getSupportFragmentManager();
|
||||
Fragment active;
|
||||
private DisplayVideosFragment recentFragment, locaFragment, trendingFragment, subscriptionFragment, mostLikedFragment;
|
||||
private DisplayOverviewFragment overviewFragment;
|
||||
private final BottomNavigationView.OnNavigationItemSelectedListener mOnNavigationItemSelectedListener
|
||||
= item -> {
|
||||
DisplayVideosFragment displayVideosFragment = null;
|
||||
int itemId = item.getItemId();
|
||||
if (itemId == R.id.navigation_subscription) {
|
||||
displayVideosFragment = subscriptionFragment;
|
||||
setTitleCustom(R.string.subscriptions);
|
||||
} else if (itemId == R.id.navigation_trending) {
|
||||
setTitleCustom(R.string.title_trending);
|
||||
displayVideosFragment = trendingFragment;
|
||||
} else if (itemId == R.id.navigation_most_liked) {
|
||||
setTitleCustom(R.string.title_most_liked);
|
||||
displayVideosFragment = mostLikedFragment;
|
||||
} else if (itemId == R.id.navigation_recently_added) {
|
||||
setTitleCustom(R.string.title_recently_added);
|
||||
displayVideosFragment = recentFragment;
|
||||
} else if (itemId == R.id.navigation_local) {
|
||||
setTitleCustom(R.string.title_local);
|
||||
displayVideosFragment = locaFragment;
|
||||
} else if (itemId == R.id.navigation_discover) {
|
||||
setTitleCustom(R.string.title_discover);
|
||||
fm.beginTransaction().hide(active).show(overviewFragment).commit();
|
||||
active = overviewFragment;
|
||||
return true;
|
||||
}
|
||||
if (displayVideosFragment != null) {
|
||||
fm.beginTransaction().hide(active).show(displayVideosFragment).commit();
|
||||
active = displayVideosFragment;
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
};
|
||||
private ActivityMainBinding binding;
|
||||
|
||||
@SuppressLint("ApplySharedPref")
|
||||
public static void showRadioButtonDialogFullInstances(Activity activity, boolean storeInDb) {
|
||||
@ -186,13 +157,46 @@ public class MainActivity extends AppCompatActivity {
|
||||
private void setTitleCustom(int titleRId) {
|
||||
Toolbar toolbar = findViewById(R.id.toolbar);
|
||||
TextView mTitle = toolbar.findViewById(R.id.toolbar_title);
|
||||
if (mTitle != null) {
|
||||
mTitle.setText(getString(titleRId));
|
||||
}
|
||||
}
|
||||
|
||||
private final BottomNavigationView.OnNavigationItemSelectedListener mOnNavigationItemSelectedListener
|
||||
= item -> {
|
||||
int itemId = item.getItemId();
|
||||
if (itemId == R.id.navigation_discover) {
|
||||
setTitleCustom(R.string.title_discover);
|
||||
binding.viewpager.setCurrentItem(0);
|
||||
} else if (itemId == R.id.navigation_subscription) {
|
||||
binding.viewpager.setCurrentItem(1);
|
||||
setTitleCustom(R.string.subscriptions);
|
||||
} else if (itemId == R.id.navigation_trending) {
|
||||
setTitleCustom(R.string.title_trending);
|
||||
if (Helper.isLoggedIn(MainActivity.this)) {
|
||||
binding.viewpager.setCurrentItem(2);
|
||||
} else {
|
||||
binding.viewpager.setCurrentItem(1);
|
||||
}
|
||||
} else if (itemId == R.id.navigation_most_liked) {
|
||||
setTitleCustom(R.string.title_most_liked);
|
||||
binding.viewpager.setCurrentItem(2);
|
||||
} else if (itemId == R.id.navigation_recently_added) {
|
||||
setTitleCustom(R.string.title_recently_added);
|
||||
binding.viewpager.setCurrentItem(3);
|
||||
} else if (itemId == R.id.navigation_local) {
|
||||
setTitleCustom(R.string.title_local);
|
||||
binding.viewpager.setCurrentItem(4);
|
||||
}
|
||||
return true;
|
||||
};
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.activity_main);
|
||||
binding = ActivityMainBinding.inflate(getLayoutInflater());
|
||||
View view = binding.getRoot();
|
||||
setContentView(view);
|
||||
|
||||
Toolbar toolbar = findViewById(R.id.toolbar);
|
||||
setSupportActionBar(toolbar);
|
||||
@ -208,22 +212,6 @@ public class MainActivity extends AppCompatActivity {
|
||||
}
|
||||
checkIfConnectedUsers();
|
||||
|
||||
Fragment fragment = getSupportFragmentManager().findFragmentByTag("5");
|
||||
if (fragment != null)
|
||||
getSupportFragmentManager().beginTransaction().remove(fragment).commit();
|
||||
fragment = getSupportFragmentManager().findFragmentByTag("4");
|
||||
if (fragment != null)
|
||||
getSupportFragmentManager().beginTransaction().remove(fragment).commit();
|
||||
fragment = getSupportFragmentManager().findFragmentByTag("3");
|
||||
if (fragment != null)
|
||||
getSupportFragmentManager().beginTransaction().remove(fragment).commit();
|
||||
fragment = getSupportFragmentManager().findFragmentByTag("2");
|
||||
if (fragment != null)
|
||||
getSupportFragmentManager().beginTransaction().remove(fragment).commit();
|
||||
fragment = getSupportFragmentManager().findFragmentByTag("1");
|
||||
if (fragment != null)
|
||||
getSupportFragmentManager().beginTransaction().remove(fragment).commit();
|
||||
|
||||
recentFragment = new DisplayVideosFragment();
|
||||
Bundle bundle = new Bundle();
|
||||
bundle.putSerializable(Helper.TIMELINE_TYPE, TimelineVM.TimelineType.RECENT);
|
||||
@ -250,24 +238,37 @@ public class MainActivity extends AppCompatActivity {
|
||||
mostLikedFragment.setArguments(bundle);
|
||||
|
||||
overviewFragment = new DisplayOverviewFragment();
|
||||
|
||||
if (active == null) {
|
||||
active = overviewFragment;
|
||||
}
|
||||
|
||||
|
||||
if (!Helper.isLoggedIn(MainActivity.this)) {
|
||||
fm.beginTransaction().add(R.id.nav_host_fragment, locaFragment, "5").hide(locaFragment).commit();
|
||||
fm.beginTransaction().add(R.id.nav_host_fragment, recentFragment, "4").hide(recentFragment).commit();
|
||||
fm.beginTransaction().add(R.id.nav_host_fragment, mostLikedFragment, "3").hide(mostLikedFragment).commit();
|
||||
fm.beginTransaction().add(R.id.nav_host_fragment, trendingFragment, "2").hide(trendingFragment).commit();
|
||||
fm.beginTransaction().add(R.id.nav_host_fragment, overviewFragment, "1").commit();
|
||||
PagerAdapter mPagerAdapter = new ScreenSlidePagerAdapter(getSupportFragmentManager());
|
||||
binding.viewpager.setAdapter(mPagerAdapter);
|
||||
}
|
||||
binding.viewpager.setOffscreenPageLimit(5);
|
||||
|
||||
|
||||
binding.viewpager.addOnPageChangeListener(new ViewPager.OnPageChangeListener() {
|
||||
@Override
|
||||
public void onPageScrolled(int position, float positionOffset, int positionOffsetPixels) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPageSelected(int position) {
|
||||
MenuItem item = binding.navView.getMenu().getItem(position);
|
||||
binding.navView.setSelectedItemId(item.getItemId());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPageScrollStateChanged(int state) {
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
toolbar.setOnClickListener(v -> {
|
||||
if (active instanceof DisplayVideosFragment) {
|
||||
((DisplayVideosFragment) active).scrollToTop();
|
||||
} else if (active instanceof DisplayOverviewFragment) {
|
||||
((DisplayOverviewFragment) active).scrollToTop();
|
||||
if (binding.viewpager.getAdapter().instantiateItem(binding.viewpager, binding.viewpager.getCurrentItem()) instanceof DisplayVideosFragment) {
|
||||
((DisplayVideosFragment) binding.viewpager.getAdapter().instantiateItem(binding.viewpager, binding.viewpager.getCurrentItem())).scrollToTop();
|
||||
} else if (binding.viewpager.getAdapter().instantiateItem(binding.viewpager, binding.viewpager.getCurrentItem()) instanceof DisplayOverviewFragment) {
|
||||
((DisplayOverviewFragment) binding.viewpager.getAdapter().instantiateItem(binding.viewpager, binding.viewpager.getCurrentItem())).scrollToTop();
|
||||
}
|
||||
});
|
||||
|
||||
@ -276,6 +277,43 @@ public class MainActivity extends AppCompatActivity {
|
||||
if (Helper.isLoggedIn(MainActivity.this)) {
|
||||
|
||||
navView.inflateMenu(R.menu.bottom_nav_menu_connected);
|
||||
refreshToken();
|
||||
|
||||
} else {
|
||||
navView.inflateMenu(R.menu.bottom_nav_menu);
|
||||
}
|
||||
peertubeInformation = new PeertubeInformation();
|
||||
peertubeInformation.setCategories(new LinkedHashMap<>());
|
||||
peertubeInformation.setLanguages(new LinkedHashMap<>());
|
||||
peertubeInformation.setLicences(new LinkedHashMap<>());
|
||||
peertubeInformation.setPrivacies(new LinkedHashMap<>());
|
||||
peertubeInformation.setPlaylistPrivacies(new LinkedHashMap<>());
|
||||
peertubeInformation.setTranslations(new LinkedHashMap<>());
|
||||
startInForeground();
|
||||
|
||||
if (BuildConfig.google_restriction && BuildConfig.full_instances) {
|
||||
RateThisApp.onCreate(this);
|
||||
RateThisApp.showRateDialogIfNeeded(this);
|
||||
}
|
||||
if (!BuildConfig.full_instances) {
|
||||
PlaylistExportHelper.manageIntentUrl(MainActivity.this, getIntent());
|
||||
}
|
||||
}
|
||||
|
||||
public DisplayVideosFragment getSubscriptionFragment() {
|
||||
return subscriptionFragment;
|
||||
}
|
||||
|
||||
private void startInForeground() {
|
||||
Intent notificationIntent = new Intent(this, RetrieveInfoService.class);
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
|
||||
startForegroundService(notificationIntent);
|
||||
} else {
|
||||
startService(notificationIntent);
|
||||
}
|
||||
}
|
||||
|
||||
private void refreshToken() {
|
||||
new Thread(() -> {
|
||||
final SharedPreferences sharedpreferences = getSharedPreferences(Helper.APP_PREFS, Context.MODE_PRIVATE);
|
||||
String tokenStr = sharedpreferences.getString(Helper.PREF_KEY_OAUTH_TOKEN, null);
|
||||
@ -298,7 +336,22 @@ public class MainActivity extends AppCompatActivity {
|
||||
try {
|
||||
Token token = new RetrofitPeertubeAPI(MainActivity.this).manageToken(oauthParams);
|
||||
if (token == null && Helper.instanceOnline(instance)) {
|
||||
runOnUiThread(() -> Helper.logoutCurrentUser(MainActivity.this, finalAccount));
|
||||
runOnUiThread(() -> {
|
||||
AlertDialog.Builder alt_bld = new AlertDialog.Builder(this);
|
||||
alt_bld.setTitle(R.string.refresh_token_failed);
|
||||
alt_bld.setMessage(R.string.refresh_token_failed_message);
|
||||
alt_bld.setNegativeButton(R.string.action_logout, (dialog, id) -> {
|
||||
dialog.dismiss();
|
||||
Helper.logoutCurrentUser(MainActivity.this, finalAccount);
|
||||
});
|
||||
alt_bld.setPositiveButton(R.string._retry, (dialog, id) -> {
|
||||
dialog.dismiss();
|
||||
refreshToken();
|
||||
});
|
||||
AlertDialog alert = alt_bld.create();
|
||||
alert.show();
|
||||
|
||||
});
|
||||
return;
|
||||
} else if (token == null) {
|
||||
return;
|
||||
@ -306,11 +359,10 @@ public class MainActivity extends AppCompatActivity {
|
||||
runOnUiThread(() -> {
|
||||
//To avoid a token issue with subscriptions, adding fragment is done when the token is refreshed.
|
||||
new Handler().post(() -> {
|
||||
fm.beginTransaction().add(R.id.nav_host_fragment, locaFragment, "5").hide(locaFragment).commit();
|
||||
fm.beginTransaction().add(R.id.nav_host_fragment, recentFragment, "4").hide(recentFragment).commitAllowingStateLoss();
|
||||
fm.beginTransaction().add(R.id.nav_host_fragment, trendingFragment, "3").hide(trendingFragment).commitAllowingStateLoss();
|
||||
fm.beginTransaction().add(R.id.nav_host_fragment, subscriptionFragment, "2").hide(subscriptionFragment).commitAllowingStateLoss();
|
||||
fm.beginTransaction().add(R.id.nav_host_fragment, overviewFragment, "1").commitAllowingStateLoss();
|
||||
if (Helper.isLoggedIn(MainActivity.this)) {
|
||||
PagerAdapter mPagerAdapter = new ScreenSlidePagerAdapter(getSupportFragmentManager());
|
||||
binding.viewpager.setAdapter(mPagerAdapter);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
@ -337,41 +389,13 @@ public class MainActivity extends AppCompatActivity {
|
||||
editor.apply();
|
||||
}
|
||||
}
|
||||
instanceConfig = new RetrofitPeertubeAPI(MainActivity.this).getConfigInstance();
|
||||
} catch (Error error) {
|
||||
runOnUiThread(() -> Helper.logoutCurrentUser(MainActivity.this, finalAccount));
|
||||
error.printStackTrace();
|
||||
}
|
||||
}
|
||||
}).start();
|
||||
|
||||
} else {
|
||||
navView.inflateMenu(R.menu.bottom_nav_menu);
|
||||
}
|
||||
peertubeInformation = new PeertubeInformation();
|
||||
peertubeInformation.setCategories(new LinkedHashMap<>());
|
||||
peertubeInformation.setLanguages(new LinkedHashMap<>());
|
||||
peertubeInformation.setLicences(new LinkedHashMap<>());
|
||||
peertubeInformation.setPrivacies(new LinkedHashMap<>());
|
||||
peertubeInformation.setPlaylistPrivacies(new LinkedHashMap<>());
|
||||
peertubeInformation.setTranslations(new LinkedHashMap<>());
|
||||
startInForeground();
|
||||
|
||||
if (BuildConfig.google_restriction && BuildConfig.full_instances) {
|
||||
RateThisApp.onCreate(this);
|
||||
RateThisApp.showRateDialogIfNeeded(this);
|
||||
}
|
||||
if (!BuildConfig.full_instances) {
|
||||
PlaylistExportHelper.manageIntentUrl(MainActivity.this, getIntent());
|
||||
}
|
||||
}
|
||||
|
||||
private void startInForeground() {
|
||||
Intent notificationIntent = new Intent(this, RetrieveInfoService.class);
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
|
||||
startForegroundService(notificationIntent);
|
||||
} else {
|
||||
startService(notificationIntent);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -601,13 +625,6 @@ public class MainActivity extends AppCompatActivity {
|
||||
return super.onOptionsItemSelected(item);
|
||||
}
|
||||
|
||||
public void setActive(DisplayVideosFragment displayVideosFragment) {
|
||||
this.active = displayVideosFragment;
|
||||
}
|
||||
|
||||
public void setSubscriptionFragment(DisplayVideosFragment displayVideosFragment) {
|
||||
this.subscriptionFragment = displayVideosFragment;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onNewIntent(Intent intent) {
|
||||
@ -667,6 +684,50 @@ public class MainActivity extends AppCompatActivity {
|
||||
}
|
||||
}
|
||||
|
||||
private class ScreenSlidePagerAdapter extends FragmentStatePagerAdapter {
|
||||
|
||||
ScreenSlidePagerAdapter(FragmentManager fm) {
|
||||
super(fm, BEHAVIOR_RESUME_ONLY_CURRENT_FRAGMENT);
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public Fragment getItem(final int position) {
|
||||
if (Helper.isLoggedIn(MainActivity.this)) {
|
||||
switch (position) {
|
||||
case 0:
|
||||
return overviewFragment;
|
||||
case 1:
|
||||
return subscriptionFragment;
|
||||
case 2:
|
||||
return trendingFragment;
|
||||
case 3:
|
||||
return recentFragment;
|
||||
case 4:
|
||||
return locaFragment;
|
||||
}
|
||||
} else {
|
||||
switch (position) {
|
||||
case 0:
|
||||
return overviewFragment;
|
||||
case 1:
|
||||
return trendingFragment;
|
||||
case 2:
|
||||
return mostLikedFragment;
|
||||
case 3:
|
||||
return recentFragment;
|
||||
case 4:
|
||||
return locaFragment;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getCount() {
|
||||
return 5;
|
||||
}
|
||||
}
|
||||
|
||||
public enum TypeOfConnection {
|
||||
UNKNOWN,
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -16,21 +16,17 @@ package app.fedilab.fedilabtube;
|
||||
|
||||
import android.Manifest;
|
||||
import android.app.Activity;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.content.SharedPreferences;
|
||||
import android.content.pm.PackageManager;
|
||||
import android.net.Uri;
|
||||
import android.os.Bundle;
|
||||
import android.os.Handler;
|
||||
import android.os.Looper;
|
||||
import android.view.MenuItem;
|
||||
import android.view.View;
|
||||
import android.widget.AdapterView;
|
||||
import android.widget.ArrayAdapter;
|
||||
import android.widget.Button;
|
||||
import android.widget.CheckBox;
|
||||
import android.widget.EditText;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.Spinner;
|
||||
import android.widget.Toast;
|
||||
|
||||
import androidx.appcompat.app.AlertDialog;
|
||||
@ -40,39 +36,34 @@ import androidx.core.content.ContextCompat;
|
||||
import androidx.lifecycle.ViewModelProvider;
|
||||
|
||||
import com.bumptech.glide.Glide;
|
||||
import com.bumptech.glide.load.resource.bitmap.CenterCrop;
|
||||
import com.bumptech.glide.load.resource.bitmap.RoundedCorners;
|
||||
import com.bumptech.glide.request.RequestOptions;
|
||||
|
||||
import net.gotev.uploadservice.MultipartUploadRequest;
|
||||
import net.gotev.uploadservice.ServerResponse;
|
||||
import net.gotev.uploadservice.UploadInfo;
|
||||
import net.gotev.uploadservice.UploadNotificationConfig;
|
||||
import net.gotev.uploadservice.UploadStatusDelegate;
|
||||
|
||||
import java.io.FileNotFoundException;
|
||||
import java.net.MalformedURLException;
|
||||
import java.util.Iterator;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.UUID;
|
||||
|
||||
import app.fedilab.fedilabtube.client.APIResponse;
|
||||
import app.fedilab.fedilabtube.client.RetrofitPeertubeAPI;
|
||||
import app.fedilab.fedilabtube.client.data.ChannelData.Channel;
|
||||
import app.fedilab.fedilabtube.client.data.VideoData;
|
||||
import app.fedilab.fedilabtube.client.data.VideoData.Video;
|
||||
import app.fedilab.fedilabtube.client.entities.Item;
|
||||
import app.fedilab.fedilabtube.client.entities.ItemStr;
|
||||
import app.fedilab.fedilabtube.client.entities.VideoParams;
|
||||
import app.fedilab.fedilabtube.databinding.ActivityPeertubeEditBinding;
|
||||
import app.fedilab.fedilabtube.helper.Helper;
|
||||
import app.fedilab.fedilabtube.viewmodel.ChannelsVM;
|
||||
import app.fedilab.fedilabtube.viewmodel.MyVideoVM;
|
||||
import app.fedilab.fedilabtube.viewmodel.PostActionsVM;
|
||||
import app.fedilab.fedilabtube.viewmodel.TimelineVM;
|
||||
import es.dmoral.toasty.Toasty;
|
||||
import mabbas007.tagsedittext.TagsEditText;
|
||||
|
||||
import static app.fedilab.fedilabtube.MainActivity.peertubeInformation;
|
||||
import static app.fedilab.fedilabtube.client.RetrofitPeertubeAPI.ActionType.PEERTUBEDELETEVIDEO;
|
||||
import static app.fedilab.fedilabtube.client.RetrofitPeertubeAPI.DataType.MY_CHANNELS;
|
||||
import static app.fedilab.fedilabtube.helper.Helper.peertubeInformation;
|
||||
|
||||
|
||||
public class PeertubeEditUploadActivity extends AppCompatActivity {
|
||||
@ -82,23 +73,21 @@ public class PeertubeEditUploadActivity extends AppCompatActivity {
|
||||
private final int MY_PERMISSIONS_REQUEST_READ_EXTERNAL_STORAGE = 724;
|
||||
Item licenseToSend, privacyToSend, categoryToSend;
|
||||
ItemStr languageToSend;
|
||||
private Button set_upload_submit;
|
||||
private Spinner set_upload_privacy, set_upload_categories, set_upload_licenses, set_upload_languages, set_upload_channel;
|
||||
private EditText p_video_title, p_video_description;
|
||||
private TagsEditText p_video_tags;
|
||||
private CheckBox set_upload_nsfw, set_upload_enable_comments;
|
||||
private LinkedHashMap<String, String> channels;
|
||||
private String videoId;
|
||||
private Channel channel;
|
||||
private ImageView p_video_preview;
|
||||
private Button set_preview;
|
||||
private VideoParams videoParams;
|
||||
private Video video;
|
||||
private String channelToSendId;
|
||||
private ActivityPeertubeEditBinding binding;
|
||||
private Uri inputData;
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
binding = ActivityPeertubeEditBinding.inflate(getLayoutInflater());
|
||||
View view = binding.getRoot();
|
||||
setContentView(view);
|
||||
|
||||
SharedPreferences sharedpreferences = getSharedPreferences(Helper.APP_PREFS, MODE_PRIVATE);
|
||||
|
||||
@ -113,23 +102,8 @@ public class PeertubeEditUploadActivity extends AppCompatActivity {
|
||||
}
|
||||
if (getSupportActionBar() != null)
|
||||
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
|
||||
setContentView(R.layout.activity_peertube_edit);
|
||||
set_upload_submit = findViewById(R.id.set_upload_submit);
|
||||
Button set_upload_delete = findViewById(R.id.set_upload_delete);
|
||||
set_upload_privacy = findViewById(R.id.set_upload_privacy);
|
||||
set_upload_channel = findViewById(R.id.set_upload_channel);
|
||||
set_upload_categories = findViewById(R.id.set_upload_categories);
|
||||
set_upload_licenses = findViewById(R.id.set_upload_licenses);
|
||||
set_upload_languages = findViewById(R.id.set_upload_languages);
|
||||
p_video_title = findViewById(R.id.p_video_title);
|
||||
p_video_description = findViewById(R.id.p_video_description);
|
||||
p_video_tags = findViewById(R.id.p_video_tags);
|
||||
p_video_preview = findViewById(R.id.p_video_preview);
|
||||
set_upload_nsfw = findViewById(R.id.set_upload_nsfw);
|
||||
set_upload_enable_comments = findViewById(R.id.set_upload_enable_comments);
|
||||
set_preview = findViewById(R.id.set_preview);
|
||||
|
||||
set_upload_delete.setOnClickListener(v -> {
|
||||
binding.setUploadDelete.setOnClickListener(v -> {
|
||||
AlertDialog.Builder builderInner;
|
||||
builderInner = new AlertDialog.Builder(PeertubeEditUploadActivity.this);
|
||||
builderInner.setMessage(getString(R.string.delete_video_confirmation));
|
||||
@ -165,7 +139,7 @@ public class PeertubeEditUploadActivity extends AppCompatActivity {
|
||||
}
|
||||
ArrayAdapter<String> adapterCatgories = new ArrayAdapter<>(PeertubeEditUploadActivity.this,
|
||||
android.R.layout.simple_spinner_dropdown_item, categoriesA);
|
||||
set_upload_categories.setAdapter(adapterCatgories);
|
||||
binding.setUploadCategories.setAdapter(adapterCatgories);
|
||||
|
||||
|
||||
//Populate licenses
|
||||
@ -183,7 +157,7 @@ public class PeertubeEditUploadActivity extends AppCompatActivity {
|
||||
}
|
||||
ArrayAdapter<String> adapterLicenses = new ArrayAdapter<>(PeertubeEditUploadActivity.this,
|
||||
android.R.layout.simple_spinner_dropdown_item, licensesA);
|
||||
set_upload_licenses.setAdapter(adapterLicenses);
|
||||
binding.setUploadLicenses.setAdapter(adapterLicenses);
|
||||
|
||||
|
||||
//Populate languages
|
||||
@ -201,7 +175,7 @@ public class PeertubeEditUploadActivity extends AppCompatActivity {
|
||||
}
|
||||
ArrayAdapter<String> adapterLanguages = new ArrayAdapter<>(PeertubeEditUploadActivity.this,
|
||||
android.R.layout.simple_spinner_dropdown_item, languagesA);
|
||||
set_upload_languages.setAdapter(adapterLanguages);
|
||||
binding.setUploadLanguages.setAdapter(adapterLanguages);
|
||||
|
||||
|
||||
//Populate languages
|
||||
@ -220,18 +194,19 @@ public class PeertubeEditUploadActivity extends AppCompatActivity {
|
||||
|
||||
ArrayAdapter<String> adapterPrivacies = new ArrayAdapter<>(PeertubeEditUploadActivity.this,
|
||||
android.R.layout.simple_spinner_dropdown_item, privaciesA);
|
||||
set_upload_privacy.setAdapter(adapterPrivacies);
|
||||
binding.setUploadPrivacy.setAdapter(adapterPrivacies);
|
||||
|
||||
|
||||
TimelineVM feedsViewModel = new ViewModelProvider(PeertubeEditUploadActivity.this).get(TimelineVM.class);
|
||||
feedsViewModel.getMyVideo(null, videoId).observe(PeertubeEditUploadActivity.this, this::manageVIewVideo);
|
||||
|
||||
channels = new LinkedHashMap<>();
|
||||
|
||||
setTitle(R.string.edit_video);
|
||||
}
|
||||
|
||||
public void manageUpdate(APIResponse apiResponse) {
|
||||
set_upload_submit.setEnabled(true);
|
||||
binding.setUploadSubmit.setEnabled(true);
|
||||
if (apiResponse.getError() != null) {
|
||||
if (apiResponse.getError() != null && apiResponse.getError().getError() != null)
|
||||
Toasty.error(PeertubeEditUploadActivity.this, apiResponse.getError().getError(), Toast.LENGTH_LONG).show();
|
||||
@ -247,7 +222,7 @@ public class PeertubeEditUploadActivity extends AppCompatActivity {
|
||||
Toasty.error(PeertubeEditUploadActivity.this, apiResponse.getError().getError(), Toast.LENGTH_LONG).show();
|
||||
else
|
||||
Toasty.error(PeertubeEditUploadActivity.this, getString(R.string.toast_error), Toast.LENGTH_LONG).show();
|
||||
set_upload_submit.setEnabled(true);
|
||||
binding.setUploadSubmit.setEnabled(true);
|
||||
return;
|
||||
}
|
||||
|
||||
@ -263,11 +238,11 @@ public class PeertubeEditUploadActivity extends AppCompatActivity {
|
||||
categoryToSend = video.getCategory();
|
||||
|
||||
if (video.getThumbnailPath() != null) {
|
||||
Helper.loadGiF(PeertubeEditUploadActivity.this, video.getThumbnailPath(), p_video_preview);
|
||||
Helper.loadGiF(PeertubeEditUploadActivity.this, video.getThumbnailPath(), binding.pVideoPreview);
|
||||
}
|
||||
|
||||
|
||||
set_preview.setOnClickListener(v -> {
|
||||
binding.setPreview.setOnClickListener(v -> {
|
||||
if (ContextCompat.checkSelfPermission(PeertubeEditUploadActivity.this, Manifest.permission.READ_EXTERNAL_STORAGE) !=
|
||||
PackageManager.PERMISSION_GRANTED) {
|
||||
ActivityCompat.requestPermissions(PeertubeEditUploadActivity.this,
|
||||
@ -324,11 +299,28 @@ public class PeertubeEditUploadActivity extends AppCompatActivity {
|
||||
boolean commentEnabled = video.isCommentsEnabled();
|
||||
boolean isNSFW = video.isNsfw();
|
||||
|
||||
set_upload_enable_comments.setChecked(commentEnabled);
|
||||
set_upload_nsfw.setChecked(isNSFW);
|
||||
binding.setUploadEnableComments.setChecked(commentEnabled);
|
||||
binding.setUploadNsfw.setChecked(isNSFW);
|
||||
|
||||
p_video_title.setText(title);
|
||||
p_video_description.setText(video.getDescription());
|
||||
binding.pVideoTitle.setText(title);
|
||||
binding.pVideoDescription.setText(video.getDescription());
|
||||
|
||||
new Thread(() -> {
|
||||
try {
|
||||
RetrofitPeertubeAPI api;
|
||||
api = new RetrofitPeertubeAPI(PeertubeEditUploadActivity.this);
|
||||
VideoData.Description description = api.getVideoDescription(video.getUuid());
|
||||
Handler mainHandler = new Handler(Looper.getMainLooper());
|
||||
Runnable myRunnable = () -> {
|
||||
if (description != null) {
|
||||
binding.pVideoDescription.setText(description.getDescription());
|
||||
}
|
||||
};
|
||||
mainHandler.post(myRunnable);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}).start();
|
||||
|
||||
LinkedHashMap<Integer, String> categories = new LinkedHashMap<>(peertubeInformation.getCategories());
|
||||
LinkedHashMap<Integer, String> licences = new LinkedHashMap<>(peertubeInformation.getLicences());
|
||||
@ -382,7 +374,7 @@ public class PeertubeEditUploadActivity extends AppCompatActivity {
|
||||
}
|
||||
}
|
||||
//Manage privacies
|
||||
set_upload_privacy.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
|
||||
binding.setUploadPrivacy.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
|
||||
@Override
|
||||
public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {
|
||||
updatePrivacyPosition(position);
|
||||
@ -393,7 +385,7 @@ public class PeertubeEditUploadActivity extends AppCompatActivity {
|
||||
|
||||
}
|
||||
});
|
||||
set_upload_licenses.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
|
||||
binding.setUploadLicenses.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
|
||||
@Override
|
||||
public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {
|
||||
updateLicensePosition(position);
|
||||
@ -405,7 +397,7 @@ public class PeertubeEditUploadActivity extends AppCompatActivity {
|
||||
}
|
||||
});
|
||||
//Manage categories
|
||||
set_upload_categories.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
|
||||
binding.setUploadCategories.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
|
||||
@Override
|
||||
public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {
|
||||
updateCategoryPosition(position);
|
||||
@ -418,7 +410,7 @@ public class PeertubeEditUploadActivity extends AppCompatActivity {
|
||||
});
|
||||
|
||||
//Manage languages
|
||||
set_upload_languages.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
|
||||
binding.setUploadLanguages.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
|
||||
@Override
|
||||
public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {
|
||||
updateLanguagesPosition(position);
|
||||
@ -430,7 +422,7 @@ public class PeertubeEditUploadActivity extends AppCompatActivity {
|
||||
}
|
||||
});
|
||||
//Manage languages
|
||||
set_upload_channel.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
|
||||
binding.setUploadChannel.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
|
||||
@Override
|
||||
public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {
|
||||
|
||||
@ -447,11 +439,11 @@ public class PeertubeEditUploadActivity extends AppCompatActivity {
|
||||
Item finalLicenseToSend = licenseToSend;
|
||||
ItemStr finalLanguageToSend = languageToSend;
|
||||
Item finalPrivacyToSend = privacyToSend;
|
||||
set_upload_submit.setOnClickListener(v -> {
|
||||
String title1 = p_video_title.getText().toString().trim();
|
||||
String description = p_video_description.getText().toString().trim();
|
||||
boolean isNSFW1 = set_upload_nsfw.isChecked();
|
||||
boolean commentEnabled1 = set_upload_enable_comments.isChecked();
|
||||
binding.setUploadSubmit.setOnClickListener(v -> {
|
||||
String title1 = binding.pVideoTitle.getText() != null ? binding.pVideoTitle.getText().toString().trim() : "";
|
||||
String description = binding.pVideoDescription.getText() != null ? binding.pVideoDescription.getText().toString().trim() : "";
|
||||
boolean isNSFW1 = binding.setUploadNsfw.isChecked();
|
||||
boolean commentEnabled1 = binding.setUploadEnableComments.isChecked();
|
||||
videoParams = new VideoParams();
|
||||
videoParams.setName(title1);
|
||||
videoParams.setDescription(description);
|
||||
@ -460,28 +452,27 @@ public class PeertubeEditUploadActivity extends AppCompatActivity {
|
||||
videoParams.setCategory(finalCategoryToSend.getId());
|
||||
videoParams.setLicence(String.valueOf(finalLicenseToSend.getId()));
|
||||
videoParams.setLanguage(finalLanguageToSend.getId());
|
||||
|
||||
videoParams.setChannelId(channelToSendId);
|
||||
videoParams.setPrivacy(finalPrivacyToSend.getId());
|
||||
List<String> tags = p_video_tags.getTags();
|
||||
List<String> tags = binding.pVideoTags.getTags();
|
||||
videoParams.setTags(tags);
|
||||
set_upload_submit.setEnabled(false);
|
||||
binding.setUploadSubmit.setEnabled(false);
|
||||
MyVideoVM myVideoVM = new ViewModelProvider(PeertubeEditUploadActivity.this).get(MyVideoVM.class);
|
||||
myVideoVM.updateVideo(videoId, videoParams, null, null).observe(PeertubeEditUploadActivity.this, this::manageUpdate);
|
||||
myVideoVM.updateVideo(videoId, videoParams, inputData, inputData).observe(PeertubeEditUploadActivity.this, this::manageUpdate);
|
||||
});
|
||||
|
||||
set_upload_privacy.setSelection(privacyPosition, false);
|
||||
binding.setUploadPrivacy.setSelection(privacyPosition, false);
|
||||
updatePrivacyPosition(privacyPosition);
|
||||
set_upload_languages.setSelection(languagePosition, false);
|
||||
binding.setUploadLanguages.setSelection(languagePosition, false);
|
||||
updateLanguagesPosition(languagePosition);
|
||||
set_upload_licenses.setSelection(licensePosition, false);
|
||||
binding.setUploadLicenses.setSelection(licensePosition, false);
|
||||
updateLicensePosition(licensePosition);
|
||||
set_upload_categories.setSelection(categoryPosition, false);
|
||||
binding.setUploadCategories.setSelection(categoryPosition, false);
|
||||
updateCategoryPosition(categoryPosition);
|
||||
|
||||
List<String> tags = video.getTags();
|
||||
if (tags != null && tags.size() > 0) {
|
||||
p_video_tags.setTags(tags.toArray(new String[0]));
|
||||
binding.pVideoTags.setTags(tags.toArray(new String[0]));
|
||||
}
|
||||
}
|
||||
|
||||
@ -572,53 +563,12 @@ public class PeertubeEditUploadActivity extends AppCompatActivity {
|
||||
Toasty.error(PeertubeEditUploadActivity.this, getString(R.string.toot_select_image_error), Toast.LENGTH_LONG).show();
|
||||
return;
|
||||
}
|
||||
UploadNotificationConfig uploadConfig = new UploadNotificationConfig();
|
||||
uploadConfig.getCompleted().autoClear = true;
|
||||
try {
|
||||
SharedPreferences sharedpreferences = getSharedPreferences(Helper.APP_PREFS, Context.MODE_PRIVATE);
|
||||
String token = sharedpreferences.getString(Helper.PREF_KEY_OAUTH_TOKEN, null);
|
||||
Uri uri = data.getData();
|
||||
try {
|
||||
String uploadId = UUID.randomUUID().toString();
|
||||
new MultipartUploadRequest(PeertubeEditUploadActivity.this, uploadId, "https://" + Helper.getLiveInstance(PeertubeEditUploadActivity.this) + "/api/v1/" + String.format("/videos/%s", video.getId()))
|
||||
.addFileToUpload(uri.toString().replace("file://", ""), "thumbnailfile")
|
||||
.setMethod("PUT")
|
||||
.addHeader("Authorization", "Bearer " + token)
|
||||
.setNotificationConfig(uploadConfig)
|
||||
.setMaxRetries(2)
|
||||
.setDelegate(new UploadStatusDelegate() {
|
||||
@Override
|
||||
public void onProgress(Context context, UploadInfo uploadInfo) {
|
||||
// your code here
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(Context context, UploadInfo uploadInfo, ServerResponse serverResponse,
|
||||
Exception exception) {
|
||||
Toasty.error(PeertubeEditUploadActivity.this, getString(R.string.toast_error), Toast.LENGTH_LONG).show();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCompleted(Context context, UploadInfo uploadInfo, ServerResponse serverResponse) {
|
||||
inputData = data.getData();
|
||||
Glide.with(PeertubeEditUploadActivity.this)
|
||||
.load(uri)
|
||||
.into(p_video_preview);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCancelled(Context context, UploadInfo uploadInfo) {
|
||||
// your code here
|
||||
}
|
||||
})
|
||||
.startUpload();
|
||||
} catch (FileNotFoundException e) {
|
||||
Toasty.error(PeertubeEditUploadActivity.this, getString(R.string.toast_error), Toast.LENGTH_LONG).show();
|
||||
e.printStackTrace();
|
||||
}
|
||||
} catch (MalformedURLException e) {
|
||||
Toasty.error(PeertubeEditUploadActivity.this, getString(R.string.toast_error), Toast.LENGTH_LONG).show();
|
||||
e.printStackTrace();
|
||||
}
|
||||
.load(data.getData())
|
||||
.thumbnail(0.1f)
|
||||
.apply(new RequestOptions().transform(new CenterCrop(), new RoundedCorners(10)))
|
||||
.into(binding.pVideoPreview);
|
||||
}
|
||||
}
|
||||
|
||||
@ -651,7 +601,7 @@ public class PeertubeEditUploadActivity extends AppCompatActivity {
|
||||
}
|
||||
ArrayAdapter<String> adapterChannel = new ArrayAdapter<>(PeertubeEditUploadActivity.this,
|
||||
android.R.layout.simple_spinner_dropdown_item, channelName);
|
||||
set_upload_channel.setAdapter(adapterChannel);
|
||||
binding.setUploadChannel.setAdapter(adapterChannel);
|
||||
int channelPosition = 0;
|
||||
if (channels.containsKey(channel.getName())) {
|
||||
LinkedHashMap<String, String> channelsIterator = new LinkedHashMap<>(channels);
|
||||
@ -666,9 +616,15 @@ public class PeertubeEditUploadActivity extends AppCompatActivity {
|
||||
channelPosition++;
|
||||
}
|
||||
}
|
||||
set_upload_channel.setSelection(channelPosition, false);
|
||||
binding.setUploadChannel.setSelection(channelPosition, false);
|
||||
updateUploadChannel(channelPosition);
|
||||
set_upload_submit.setEnabled(true);
|
||||
binding.setUploadSubmit.setEnabled(true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBackPressed() {
|
||||
super.onBackPressed();
|
||||
finish();
|
||||
}
|
||||
|
||||
@SuppressWarnings({"unused", "RedundantSuppression"})
|
||||
|
@ -21,46 +21,50 @@ import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.content.SharedPreferences;
|
||||
import android.content.pm.PackageManager;
|
||||
import android.database.Cursor;
|
||||
import android.graphics.Color;
|
||||
import android.net.Uri;
|
||||
import android.os.Build;
|
||||
import android.os.Bundle;
|
||||
import android.provider.OpenableColumns;
|
||||
import android.view.MenuItem;
|
||||
import android.view.View;
|
||||
import android.widget.AdapterView;
|
||||
import android.widget.ArrayAdapter;
|
||||
import android.widget.Button;
|
||||
import android.widget.EditText;
|
||||
import android.widget.Spinner;
|
||||
import android.widget.TextView;
|
||||
import android.widget.Toast;
|
||||
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
import androidx.core.app.ActivityCompat;
|
||||
import androidx.core.content.ContextCompat;
|
||||
import androidx.documentfile.provider.DocumentFile;
|
||||
import androidx.lifecycle.ViewModelProvider;
|
||||
|
||||
import net.gotev.uploadservice.MultipartUploadRequest;
|
||||
import net.gotev.uploadservice.UploadNotificationAction;
|
||||
import net.gotev.uploadservice.UploadNotificationConfig;
|
||||
|
||||
import java.io.File;
|
||||
import net.gotev.uploadservice.data.UploadNotificationAction;
|
||||
import net.gotev.uploadservice.data.UploadNotificationConfig;
|
||||
import net.gotev.uploadservice.data.UploadNotificationStatusConfig;
|
||||
import net.gotev.uploadservice.extensions.ContextExtensionsKt;
|
||||
import net.gotev.uploadservice.protocols.multipart.MultipartUploadRequest;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.Iterator;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
import java.util.Map;
|
||||
import java.util.UUID;
|
||||
|
||||
import app.fedilab.fedilabtube.client.APIResponse;
|
||||
import app.fedilab.fedilabtube.client.RetrofitPeertubeAPI;
|
||||
import app.fedilab.fedilabtube.client.data.ChannelData;
|
||||
import app.fedilab.fedilabtube.client.entities.UserMe;
|
||||
import app.fedilab.fedilabtube.databinding.ActivityPeertubeUploadBinding;
|
||||
import app.fedilab.fedilabtube.helper.Helper;
|
||||
import app.fedilab.fedilabtube.viewmodel.ChannelsVM;
|
||||
import es.dmoral.toasty.Toasty;
|
||||
|
||||
import static app.fedilab.fedilabtube.MainActivity.peertubeInformation;
|
||||
import static app.fedilab.fedilabtube.MainActivity.userMe;
|
||||
import static app.fedilab.fedilabtube.client.RetrofitPeertubeAPI.DataType.MY_CHANNELS;
|
||||
import static app.fedilab.fedilabtube.helper.Helper.peertubeInformation;
|
||||
|
||||
|
||||
public class PeertubeUploadActivity extends AppCompatActivity {
|
||||
@ -68,16 +72,12 @@ public class PeertubeUploadActivity extends AppCompatActivity {
|
||||
|
||||
public static final int MY_PERMISSIONS_REQUEST_READ_EXTERNAL_STORAGE = 724;
|
||||
private final int PICK_IVDEO = 52378;
|
||||
private Button set_upload_file, set_upload_submit;
|
||||
private Spinner set_upload_privacy, set_upload_channel;
|
||||
private TextView set_upload_file_name;
|
||||
private EditText video_title;
|
||||
private HashMap<String, String> channels;
|
||||
private Uri uri;
|
||||
private String filename;
|
||||
private HashMap<Integer, String> privacyToSend;
|
||||
private HashMap<String, String> channelToSend;
|
||||
|
||||
private ActivityPeertubeUploadBinding binding;
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
@ -86,14 +86,60 @@ public class PeertubeUploadActivity extends AppCompatActivity {
|
||||
if (getSupportActionBar() != null)
|
||||
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
|
||||
|
||||
setContentView(R.layout.activity_peertube_upload);
|
||||
binding = ActivityPeertubeUploadBinding.inflate(getLayoutInflater());
|
||||
View view = binding.getRoot();
|
||||
setContentView(view);
|
||||
|
||||
|
||||
new Thread(() -> {
|
||||
UserMe.VideoQuota videoQuotaReply = new RetrofitPeertubeAPI(PeertubeUploadActivity.this).getVideoQuota();
|
||||
runOnUiThread(() -> {
|
||||
if (videoQuotaReply != null) {
|
||||
long videoQuota = videoQuotaReply.getVideoQuotaUsed();
|
||||
long dailyQuota = videoQuotaReply.getVideoQuotaUsedDaily();
|
||||
long instanceVideoQuota = userMe.getVideoQuota();
|
||||
long instanceDailyQuota = userMe.getVideoQuotaDaily();
|
||||
|
||||
if (instanceVideoQuota != -1) {
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
|
||||
binding.totalQuota.setProgress((int) (videoQuota * 100 / instanceVideoQuota), true);
|
||||
} else {
|
||||
binding.totalQuota.setProgress((int) (videoQuota * 100 / instanceVideoQuota));
|
||||
}
|
||||
} else {
|
||||
int progress = videoQuota > 0 ? 30 : 0;
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
|
||||
binding.totalQuota.setProgress(progress, true);
|
||||
} else {
|
||||
binding.totalQuota.setProgress(progress);
|
||||
}
|
||||
}
|
||||
if (instanceDailyQuota != -1) {
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
|
||||
binding.dailyQuota.setProgress((int) (dailyQuota * 100 / instanceDailyQuota), true);
|
||||
} else {
|
||||
binding.dailyQuota.setProgress((int) (dailyQuota * 100 / instanceDailyQuota));
|
||||
}
|
||||
} else {
|
||||
int progress = dailyQuota > 0 ? 30 : 0;
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
|
||||
binding.dailyQuota.setProgress(progress, true);
|
||||
} else {
|
||||
binding.dailyQuota.setProgress(progress);
|
||||
}
|
||||
}
|
||||
binding.totalQuotaValue.setText(
|
||||
String.format(Locale.getDefault(), "%s/%s",
|
||||
Helper.returnRoundedSize(PeertubeUploadActivity.this, videoQuota),
|
||||
Helper.returnRoundedSize(PeertubeUploadActivity.this, instanceVideoQuota)));
|
||||
binding.dailyQuotaValue.setText(
|
||||
String.format(Locale.getDefault(), "%s/%s",
|
||||
Helper.returnRoundedSize(PeertubeUploadActivity.this, dailyQuota),
|
||||
Helper.returnRoundedSize(PeertubeUploadActivity.this, instanceDailyQuota)));
|
||||
}
|
||||
});
|
||||
}).start();
|
||||
|
||||
set_upload_file = findViewById(R.id.set_upload_file);
|
||||
set_upload_file_name = findViewById(R.id.set_upload_file_name);
|
||||
set_upload_channel = findViewById(R.id.set_upload_channel);
|
||||
set_upload_privacy = findViewById(R.id.set_upload_privacy);
|
||||
set_upload_submit = findViewById(R.id.set_upload_submit);
|
||||
video_title = findViewById(R.id.video_title);
|
||||
|
||||
ChannelsVM viewModelC = new ViewModelProvider(PeertubeUploadActivity.this).get(ChannelsVM.class);
|
||||
viewModelC.get(MY_CHANNELS, null).observe(PeertubeUploadActivity.this, this::manageVIewChannels);
|
||||
@ -109,33 +155,18 @@ public class PeertubeUploadActivity extends AppCompatActivity {
|
||||
Toasty.error(PeertubeUploadActivity.this, getString(R.string.toot_select_image_error), Toast.LENGTH_LONG).show();
|
||||
return;
|
||||
}
|
||||
set_upload_submit.setEnabled(true);
|
||||
|
||||
binding.setUploadSubmit.setEnabled(true);
|
||||
uri = data.getData();
|
||||
|
||||
String uriString = uri.toString();
|
||||
File myFile = new File(uriString);
|
||||
filename = null;
|
||||
if (uriString.startsWith("content://")) {
|
||||
Cursor cursor = null;
|
||||
try {
|
||||
cursor = getContentResolver().query(uri, null, null, null, null);
|
||||
if (cursor != null && cursor.moveToFirst()) {
|
||||
filename = cursor.getString(cursor.getColumnIndex(OpenableColumns.DISPLAY_NAME));
|
||||
}
|
||||
} finally {
|
||||
assert cursor != null;
|
||||
cursor.close();
|
||||
}
|
||||
} else if (uriString.startsWith("file://")) {
|
||||
filename = myFile.getName();
|
||||
DocumentFile documentFile = DocumentFile.fromSingleUri(this, uri);
|
||||
if (documentFile != null) {
|
||||
filename = documentFile.getName();
|
||||
}
|
||||
if (filename == null) {
|
||||
filename = new Date().toString();
|
||||
}
|
||||
set_upload_file_name.setVisibility(View.VISIBLE);
|
||||
set_upload_file_name.setText(filename);
|
||||
|
||||
binding.setUploadFileName.setVisibility(View.VISIBLE);
|
||||
binding.setUploadFileName.setText(filename);
|
||||
}
|
||||
}
|
||||
|
||||
@ -179,7 +210,7 @@ public class PeertubeUploadActivity extends AppCompatActivity {
|
||||
channelToSend.put(channelName[0], channelId[0]);
|
||||
ArrayAdapter<String> adapterChannel = new ArrayAdapter<>(PeertubeUploadActivity.this,
|
||||
android.R.layout.simple_spinner_dropdown_item, channelName);
|
||||
set_upload_channel.setAdapter(adapterChannel);
|
||||
binding.setUploadChannel.setAdapter(adapterChannel);
|
||||
|
||||
if (peertubeInformation == null) {
|
||||
return;
|
||||
@ -209,10 +240,10 @@ public class PeertubeUploadActivity extends AppCompatActivity {
|
||||
|
||||
ArrayAdapter<String> adapterPrivacies = new ArrayAdapter<>(PeertubeUploadActivity.this,
|
||||
android.R.layout.simple_spinner_dropdown_item, privaciesA);
|
||||
set_upload_privacy.setAdapter(adapterPrivacies);
|
||||
binding.setUploadPrivacy.setAdapter(adapterPrivacies);
|
||||
|
||||
//Manage privacies
|
||||
set_upload_privacy.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
|
||||
binding.setUploadPrivacy.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
|
||||
@Override
|
||||
public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {
|
||||
LinkedHashMap<Integer, String> privaciesCheck = new LinkedHashMap<>(peertubeInformation.getPrivacies());
|
||||
@ -235,9 +266,9 @@ public class PeertubeUploadActivity extends AppCompatActivity {
|
||||
|
||||
}
|
||||
});
|
||||
set_upload_file.setEnabled(true);
|
||||
binding.setUploadFile.setEnabled(true);
|
||||
|
||||
set_upload_file.setOnClickListener(v -> {
|
||||
binding.setUploadFile.setOnClickListener(v -> {
|
||||
if (ContextCompat.checkSelfPermission(PeertubeUploadActivity.this, Manifest.permission.READ_EXTERNAL_STORAGE) !=
|
||||
PackageManager.PERMISSION_GRANTED) {
|
||||
ActivityCompat.requestPermissions(PeertubeUploadActivity.this,
|
||||
@ -245,7 +276,7 @@ public class PeertubeUploadActivity extends AppCompatActivity {
|
||||
MY_PERMISSIONS_REQUEST_READ_EXTERNAL_STORAGE);
|
||||
return;
|
||||
}
|
||||
Intent intent = new Intent(Intent.ACTION_GET_CONTENT);
|
||||
Intent intent = new Intent(Intent.ACTION_OPEN_DOCUMENT);
|
||||
intent.addCategory(Intent.CATEGORY_OPENABLE);
|
||||
intent.setType("*/*");
|
||||
String[] mimetypes = {"video/*"};
|
||||
@ -255,7 +286,7 @@ public class PeertubeUploadActivity extends AppCompatActivity {
|
||||
});
|
||||
|
||||
//Manage languages
|
||||
set_upload_channel.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
|
||||
binding.setUploadChannel.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
|
||||
@Override
|
||||
public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {
|
||||
LinkedHashMap<String, String> channelsCheck = new LinkedHashMap<>(channels);
|
||||
@ -279,44 +310,33 @@ public class PeertubeUploadActivity extends AppCompatActivity {
|
||||
|
||||
}
|
||||
});
|
||||
set_upload_submit.setOnClickListener(v -> {
|
||||
binding.setUploadSubmit.setOnClickListener(v -> {
|
||||
if (uri != null) {
|
||||
Map.Entry<String, String> channelM = channelToSend.entrySet().iterator().next();
|
||||
String idChannel = channelM.getValue();
|
||||
Map.Entry<Integer, String> privacyM = privacyToSend.entrySet().iterator().next();
|
||||
Integer idPrivacy = privacyM.getKey();
|
||||
|
||||
if (binding.videoTitle.getText() != null && binding.videoTitle.getText().toString().trim().length() > 0) {
|
||||
filename = binding.videoTitle.getText().toString().trim();
|
||||
}
|
||||
try {
|
||||
SharedPreferences sharedpreferences = getSharedPreferences(Helper.APP_PREFS, Context.MODE_PRIVATE);
|
||||
String token = sharedpreferences.getString(Helper.PREF_KEY_OAUTH_TOKEN, null);
|
||||
UploadNotificationConfig uploadConfig = new UploadNotificationConfig();
|
||||
Intent in = new Intent(PeertubeUploadActivity.this, PeertubeEditUploadActivity.class);
|
||||
PendingIntent clickIntent = PendingIntent.getActivity(PeertubeUploadActivity.this, 1, in, PendingIntent.FLAG_UPDATE_CURRENT);
|
||||
uploadConfig
|
||||
.setClearOnActionForAllStatuses(true);
|
||||
|
||||
|
||||
uploadConfig.getProgress().message = getString(R.string.uploading);
|
||||
uploadConfig.getCompleted().message = getString(R.string.upload_video_success);
|
||||
uploadConfig.getError().message = getString(R.string.toast_error);
|
||||
uploadConfig.getCancelled().message = getString(R.string.toast_cancelled);
|
||||
uploadConfig.getCompleted().actions.add(new UploadNotificationAction(R.drawable.ic_baseline_check_24, getString(R.string.video_uploaded_action), clickIntent));
|
||||
|
||||
if (video_title != null && video_title.getText() != null && video_title.getText().toString().trim().length() > 0) {
|
||||
filename = video_title.getText().toString().trim();
|
||||
}
|
||||
String uploadId = UUID.randomUUID().toString();
|
||||
new MultipartUploadRequest(PeertubeUploadActivity.this, uploadId, "https://" + Helper.getLiveInstance(PeertubeUploadActivity.this) + "/api/v1/videos/upload")
|
||||
.addFileToUpload(uri.toString().replace("file://", ""), "videofile")
|
||||
.addHeader("Authorization", "Bearer " + token)
|
||||
.setNotificationConfig(uploadConfig)
|
||||
.addParameter("name", filename)
|
||||
.addParameter("channelId", idChannel)
|
||||
new MultipartUploadRequest(PeertubeUploadActivity.this, "https://" + Helper.getLiveInstance(PeertubeUploadActivity.this) + "/api/v1/videos/upload")
|
||||
.setMethod("POST")
|
||||
.setBearerAuth(token)
|
||||
.addHeader("User-Agent", getString(R.string.app_name) + "/" + BuildConfig.VERSION_NAME)
|
||||
.addParameter("privacy", String.valueOf(idPrivacy))
|
||||
.addParameter("nsfw", "false")
|
||||
.addParameter("name", filename)
|
||||
.addParameter("commentsEnabled", "true")
|
||||
.addParameter("downloadEnabled", "true")
|
||||
.addParameter("waitTranscoding", "true")
|
||||
.setMaxRetries(3)
|
||||
.addParameter("channelId", idChannel)
|
||||
.addFileToUpload(uri.toString(), "videofile")
|
||||
.setNotificationConfig((context, uploadId) -> getNotificationConfig(uploadId))
|
||||
.setMaxRetries(2)
|
||||
.startUpload();
|
||||
finish();
|
||||
} catch (Exception exc) {
|
||||
@ -325,4 +345,74 @@ public class PeertubeUploadActivity extends AppCompatActivity {
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
UploadNotificationConfig getNotificationConfig(String uploadId) {
|
||||
PendingIntent clickIntent = PendingIntent.getActivity(
|
||||
PeertubeUploadActivity.this, 1, new Intent(this, PeertubeEditUploadActivity.class), PendingIntent.FLAG_UPDATE_CURRENT);
|
||||
|
||||
final boolean autoClear = false;
|
||||
final boolean clearOnAction = true;
|
||||
final boolean ringToneEnabled = true;
|
||||
final ArrayList<UploadNotificationAction> noActions = new ArrayList<>(1);
|
||||
|
||||
final UploadNotificationAction cancelAction = new UploadNotificationAction(
|
||||
R.drawable.ic_baseline_cancel_24,
|
||||
getString(R.string.cancel),
|
||||
ContextExtensionsKt.getCancelUploadIntent(this, uploadId)
|
||||
);
|
||||
|
||||
|
||||
final ArrayList<UploadNotificationAction> progressActions = new ArrayList<>(1);
|
||||
progressActions.add(cancelAction);
|
||||
|
||||
UploadNotificationStatusConfig progress = new UploadNotificationStatusConfig(
|
||||
getString(R.string.app_name),
|
||||
getString(R.string.uploading),
|
||||
R.drawable.ic_baseline_cloud_upload_24,
|
||||
Color.BLUE,
|
||||
null,
|
||||
clickIntent,
|
||||
progressActions,
|
||||
clearOnAction,
|
||||
autoClear
|
||||
);
|
||||
|
||||
UploadNotificationStatusConfig success = new UploadNotificationStatusConfig(
|
||||
getString(R.string.app_name),
|
||||
getString(R.string.upload_video_success),
|
||||
R.drawable.ic_baseline_check_24,
|
||||
Color.GREEN,
|
||||
null,
|
||||
clickIntent,
|
||||
noActions,
|
||||
clearOnAction,
|
||||
autoClear
|
||||
);
|
||||
|
||||
|
||||
UploadNotificationStatusConfig error = new UploadNotificationStatusConfig(
|
||||
getString(R.string.app_name),
|
||||
getString(R.string.toast_error),
|
||||
R.drawable.ic_baseline_error_24,
|
||||
Color.RED,
|
||||
null,
|
||||
clickIntent,
|
||||
noActions,
|
||||
clearOnAction,
|
||||
autoClear
|
||||
);
|
||||
|
||||
UploadNotificationStatusConfig cancelled = new UploadNotificationStatusConfig(
|
||||
getString(R.string.app_name),
|
||||
getString(R.string.toast_cancelled),
|
||||
R.drawable.ic_baseline_cancel_24,
|
||||
Color.YELLOW,
|
||||
null,
|
||||
clickIntent,
|
||||
noActions,
|
||||
clearOnAction
|
||||
);
|
||||
|
||||
return new UploadNotificationConfig(FedilabTube.UPLOAD_CHANNEL_ID, ringToneEnabled, progress, success, error, cancelled);
|
||||
}
|
||||
}
|
||||
|
@ -16,11 +16,22 @@ package app.fedilab.fedilabtube;
|
||||
|
||||
import android.os.Bundle;
|
||||
import android.view.MenuItem;
|
||||
import android.view.View;
|
||||
import android.widget.Toast;
|
||||
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
import androidx.fragment.app.FragmentTransaction;
|
||||
import androidx.fragment.app.Fragment;
|
||||
import androidx.fragment.app.FragmentManager;
|
||||
import androidx.fragment.app.FragmentStatePagerAdapter;
|
||||
import androidx.viewpager.widget.PagerAdapter;
|
||||
import androidx.viewpager.widget.ViewPager;
|
||||
|
||||
import com.google.android.material.tabs.TabLayout;
|
||||
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import app.fedilab.fedilabtube.databinding.ActivitySearchResultBinding;
|
||||
import app.fedilab.fedilabtube.fragment.DisplayChannelsFragment;
|
||||
import app.fedilab.fedilabtube.fragment.DisplayVideosFragment;
|
||||
import es.dmoral.toasty.Toasty;
|
||||
|
||||
@ -29,12 +40,15 @@ public class SearchActivity extends AppCompatActivity {
|
||||
|
||||
|
||||
private String search;
|
||||
private ActivitySearchResultBinding binding;
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
binding = ActivitySearchResultBinding.inflate(getLayoutInflater());
|
||||
View view = binding.getRoot();
|
||||
setContentView(view);
|
||||
|
||||
setContentView(R.layout.activity_search_result);
|
||||
Bundle b = getIntent().getExtras();
|
||||
if (b != null) {
|
||||
search = b.getString("search");
|
||||
@ -46,15 +60,64 @@ public class SearchActivity extends AppCompatActivity {
|
||||
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
|
||||
setTitle(search);
|
||||
|
||||
binding.searchTabLayout.addTab(binding.searchTabLayout.newTab().setText(getString(R.string.videos)));
|
||||
binding.searchTabLayout.addTab(binding.searchTabLayout.newTab().setText(getString(R.string.channels)));
|
||||
binding.searchPager.setOffscreenPageLimit(2);
|
||||
|
||||
PagerAdapter mPagerAdapter = new ScreenSlidePagerAdapter(getSupportFragmentManager());
|
||||
binding.searchPager.setAdapter(mPagerAdapter);
|
||||
binding.searchPager.addOnPageChangeListener(new ViewPager.OnPageChangeListener() {
|
||||
@Override
|
||||
public void onPageScrolled(int position, float positionOffset, int positionOffsetPixels) {
|
||||
|
||||
if (savedInstanceState == null) {
|
||||
DisplayVideosFragment displayVideosFragment = new DisplayVideosFragment();
|
||||
Bundle bundle = new Bundle();
|
||||
bundle.putString("search_peertube", search);
|
||||
displayVideosFragment.setArguments(bundle);
|
||||
FragmentTransaction ft = getSupportFragmentManager().beginTransaction();
|
||||
ft.add(R.id.container, displayVideosFragment).commit();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPageSelected(int position) {
|
||||
TabLayout.Tab tab = binding.searchTabLayout.getTabAt(position);
|
||||
if (tab != null)
|
||||
tab.select();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPageScrollStateChanged(int state) {
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
binding.searchTabLayout.addOnTabSelectedListener(new TabLayout.OnTabSelectedListener() {
|
||||
@Override
|
||||
public void onTabSelected(TabLayout.Tab tab) {
|
||||
binding.searchPager.setCurrentItem(tab.getPosition());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onTabUnselected(TabLayout.Tab tab) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onTabReselected(TabLayout.Tab tab) {
|
||||
Fragment fragment = null;
|
||||
if (binding.searchPager.getAdapter() != null)
|
||||
fragment = (Fragment) binding.searchPager.getAdapter().instantiateItem(binding.searchPager, tab.getPosition());
|
||||
switch (tab.getPosition()) {
|
||||
case 0:
|
||||
if (fragment != null) {
|
||||
DisplayVideosFragment displayVideosFragment = ((DisplayVideosFragment) fragment);
|
||||
displayVideosFragment.scrollToTop();
|
||||
}
|
||||
break;
|
||||
case 1:
|
||||
if (fragment != null) {
|
||||
DisplayChannelsFragment displayChannelsFragment = ((DisplayChannelsFragment) fragment);
|
||||
displayChannelsFragment.scrollToTop();
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
|
||||
@ -67,4 +130,37 @@ public class SearchActivity extends AppCompatActivity {
|
||||
return super.onOptionsItemSelected(item);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Pager adapter for the 2 fragments
|
||||
*/
|
||||
private class ScreenSlidePagerAdapter extends FragmentStatePagerAdapter {
|
||||
|
||||
ScreenSlidePagerAdapter(FragmentManager fm) {
|
||||
super(fm, BEHAVIOR_RESUME_ONLY_CURRENT_FRAGMENT);
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public Fragment getItem(int position) {
|
||||
Bundle bundle = new Bundle();
|
||||
if (position == 0) {
|
||||
DisplayVideosFragment displayVideosFragment = new DisplayVideosFragment();
|
||||
bundle.putString("search_peertube", search);
|
||||
displayVideosFragment.setArguments(bundle);
|
||||
return displayVideosFragment;
|
||||
}
|
||||
DisplayChannelsFragment displayChannelsFragment = new DisplayChannelsFragment();
|
||||
bundle.putString("search_peertube", search);
|
||||
displayChannelsFragment.setArguments(bundle);
|
||||
return displayChannelsFragment;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public int getCount() {
|
||||
return 2;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -21,12 +21,8 @@ import android.view.MenuItem;
|
||||
import android.view.View;
|
||||
import android.widget.AdapterView;
|
||||
import android.widget.ArrayAdapter;
|
||||
import android.widget.Button;
|
||||
import android.widget.RadioGroup;
|
||||
import android.widget.Spinner;
|
||||
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
import androidx.constraintlayout.widget.ConstraintLayout;
|
||||
import androidx.fragment.app.Fragment;
|
||||
import androidx.fragment.app.FragmentTransaction;
|
||||
|
||||
@ -42,27 +38,29 @@ import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import app.fedilab.fedilabtube.client.entities.SepiaSearch;
|
||||
import app.fedilab.fedilabtube.databinding.ActivitySepiaSearchBinding;
|
||||
import app.fedilab.fedilabtube.fragment.DisplaySepiaSearchFragment;
|
||||
import app.fedilab.fedilabtube.helper.Helper;
|
||||
import mabbas007.tagsedittext.TagsEditText;
|
||||
|
||||
import static app.fedilab.fedilabtube.MainActivity.peertubeInformation;
|
||||
import static app.fedilab.fedilabtube.PeertubeActivity.hideKeyboard;
|
||||
import static app.fedilab.fedilabtube.helper.Helper.peertubeInformation;
|
||||
|
||||
|
||||
public class SepiaSearchActivity extends AppCompatActivity {
|
||||
|
||||
|
||||
private SepiaSearch sepiaSearchVideo, sepiaSearchChannel;
|
||||
private TagsEditText sepia_element_all_of_tags, sepia_element_one_of_tags;
|
||||
private MaterialSearchBar searchBar;
|
||||
private ConstraintLayout filter_elements;
|
||||
|
||||
private ActivitySepiaSearchBinding binding;
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
|
||||
setContentView(R.layout.activity_sepia_search);
|
||||
binding = ActivitySepiaSearchBinding.inflate(getLayoutInflater());
|
||||
View rootView = binding.getRoot();
|
||||
setContentView(rootView);
|
||||
|
||||
|
||||
sepiaSearchVideo = new SepiaSearch();
|
||||
sepiaSearchChannel = new SepiaSearch();
|
||||
@ -76,21 +74,18 @@ public class SepiaSearchActivity extends AppCompatActivity {
|
||||
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
|
||||
|
||||
|
||||
Button filter = findViewById(R.id.filter);
|
||||
filter_elements = findViewById(R.id.filter_elements);
|
||||
filter.setOnClickListener(view -> {
|
||||
if (filter_elements.getVisibility() == View.VISIBLE) {
|
||||
filter_elements.setVisibility(View.GONE);
|
||||
binding.filter.setOnClickListener(view -> {
|
||||
if (binding.filterElements.getVisibility() == View.VISIBLE) {
|
||||
binding.filterElements.setVisibility(View.GONE);
|
||||
} else {
|
||||
filter_elements.setVisibility(View.VISIBLE);
|
||||
binding.filterElements.setVisibility(View.VISIBLE);
|
||||
}
|
||||
});
|
||||
|
||||
RadioGroup sepia_element_nsfw = findViewById(R.id.sepia_element_nsfw);
|
||||
sepia_element_nsfw.setOnCheckedChangeListener((group, checkedId) -> sepiaSearchVideo.setNsfw(checkedId != R.id.sepia_element_nsfw_no));
|
||||
|
||||
RadioGroup radio_date = findViewById(R.id.radio_date);
|
||||
radio_date.setOnCheckedChangeListener((group, checkedId) -> {
|
||||
binding.sepiaElementNsfw.setOnCheckedChangeListener((group, checkedId) -> sepiaSearchVideo.setNsfw(checkedId != R.id.sepia_element_nsfw_no));
|
||||
|
||||
binding.radioDate.setOnCheckedChangeListener((group, checkedId) -> {
|
||||
if (checkedId == R.id.sepia_element_published_date_today) {
|
||||
Calendar cal = GregorianCalendar.getInstance();
|
||||
cal.set(Calendar.HOUR_OF_DAY, 0);
|
||||
@ -122,8 +117,7 @@ public class SepiaSearchActivity extends AppCompatActivity {
|
||||
});
|
||||
|
||||
|
||||
RadioGroup duration = findViewById(R.id.duration);
|
||||
duration.setOnCheckedChangeListener((group, checkedId) -> {
|
||||
binding.duration.setOnCheckedChangeListener((group, checkedId) -> {
|
||||
if (checkedId == R.id.sepia_element_duration_short) {
|
||||
sepiaSearchVideo.setDurationMin(0);
|
||||
sepiaSearchVideo.setDurationMax(240);
|
||||
@ -140,11 +134,10 @@ public class SepiaSearchActivity extends AppCompatActivity {
|
||||
});
|
||||
|
||||
|
||||
Spinner sort_by = findViewById(R.id.sort_by);
|
||||
ArrayAdapter<String> adapterSortBy = new ArrayAdapter<>(SepiaSearchActivity.this,
|
||||
android.R.layout.simple_spinner_dropdown_item, getResources().getStringArray(R.array.sort_by_array));
|
||||
sort_by.setAdapter(adapterSortBy);
|
||||
sort_by.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
|
||||
binding.sortBy.setAdapter(adapterSortBy);
|
||||
binding.sortBy.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
|
||||
@Override
|
||||
public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {
|
||||
String orderby, channelOrderBy;
|
||||
@ -171,12 +164,6 @@ public class SepiaSearchActivity extends AppCompatActivity {
|
||||
}
|
||||
});
|
||||
|
||||
Spinner sepia_element_category = findViewById(R.id.sepia_element_category);
|
||||
Spinner sepia_element_license = findViewById(R.id.sepia_element_license);
|
||||
Spinner sepia_element_language = findViewById(R.id.sepia_element_language);
|
||||
|
||||
sepia_element_all_of_tags = findViewById(R.id.sepia_element_all_of_tags);
|
||||
sepia_element_one_of_tags = findViewById(R.id.sepia_element_one_of_tags);
|
||||
|
||||
LinkedHashMap<Integer, String> categories = new LinkedHashMap<>(peertubeInformation.getCategories());
|
||||
LinkedHashMap<Integer, String> licences = new LinkedHashMap<>(peertubeInformation.getLicences());
|
||||
@ -203,7 +190,7 @@ public class SepiaSearchActivity extends AppCompatActivity {
|
||||
}
|
||||
ArrayAdapter<String> adapterCatgories = new ArrayAdapter<>(SepiaSearchActivity.this,
|
||||
android.R.layout.simple_spinner_dropdown_item, categoriesA);
|
||||
sepia_element_category.setAdapter(adapterCatgories);
|
||||
binding.sepiaElementCategory.setAdapter(adapterCatgories);
|
||||
|
||||
|
||||
//Populate licenses
|
||||
@ -222,7 +209,7 @@ public class SepiaSearchActivity extends AppCompatActivity {
|
||||
}
|
||||
ArrayAdapter<String> adapterLicenses = new ArrayAdapter<>(SepiaSearchActivity.this,
|
||||
android.R.layout.simple_spinner_dropdown_item, licensesA);
|
||||
sepia_element_license.setAdapter(adapterLicenses);
|
||||
binding.sepiaElementLicense.setAdapter(adapterLicenses);
|
||||
|
||||
//Populate languages
|
||||
String[] languagesA = new String[languages.size() + 1];
|
||||
@ -240,10 +227,10 @@ public class SepiaSearchActivity extends AppCompatActivity {
|
||||
}
|
||||
ArrayAdapter<String> adapterLanguages = new ArrayAdapter<>(SepiaSearchActivity.this,
|
||||
android.R.layout.simple_spinner_dropdown_item, languagesA);
|
||||
sepia_element_language.setAdapter(adapterLanguages);
|
||||
binding.sepiaElementLanguage.setAdapter(adapterLanguages);
|
||||
|
||||
|
||||
sepia_element_license.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
|
||||
binding.sepiaElementLicense.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
|
||||
@Override
|
||||
public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {
|
||||
updateLicensePosition(position);
|
||||
@ -255,7 +242,7 @@ public class SepiaSearchActivity extends AppCompatActivity {
|
||||
}
|
||||
});
|
||||
//Manage categories
|
||||
sepia_element_category.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
|
||||
binding.sepiaElementCategory.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
|
||||
@Override
|
||||
public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {
|
||||
updateCategoryPosition(position);
|
||||
@ -268,7 +255,7 @@ public class SepiaSearchActivity extends AppCompatActivity {
|
||||
});
|
||||
|
||||
//Manage languages
|
||||
sepia_element_language.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
|
||||
binding.sepiaElementLanguage.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
|
||||
@Override
|
||||
public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {
|
||||
updateLanguagesPosition(position);
|
||||
@ -281,9 +268,7 @@ public class SepiaSearchActivity extends AppCompatActivity {
|
||||
});
|
||||
|
||||
|
||||
searchBar = findViewById(R.id.searchBar);
|
||||
|
||||
searchBar.setOnSearchActionListener(new MaterialSearchBar.OnSearchActionListener() {
|
||||
binding.searchBar.setOnSearchActionListener(new MaterialSearchBar.OnSearchActionListener() {
|
||||
@Override
|
||||
public void onSearchStateChanged(boolean enabled) {
|
||||
|
||||
@ -299,22 +284,21 @@ public class SepiaSearchActivity extends AppCompatActivity {
|
||||
makeSearch();
|
||||
}
|
||||
});
|
||||
Button apply_filter = findViewById(R.id.apply_filter);
|
||||
apply_filter.setOnClickListener(v -> makeSearch());
|
||||
binding.applyFilter.setOnClickListener(v -> makeSearch());
|
||||
|
||||
searchBar.openSearch();
|
||||
binding.searchBar.openSearch();
|
||||
}
|
||||
|
||||
private void makeSearch() {
|
||||
hideKeyboard(SepiaSearchActivity.this);
|
||||
sepiaSearchVideo.setStart("0");
|
||||
if (sepia_element_one_of_tags.getTags().size() > 0) {
|
||||
sepiaSearchVideo.setTagsOneOf(sepia_element_one_of_tags.getTags());
|
||||
if (binding.sepiaElementOneOfTags.getTags().size() > 0) {
|
||||
sepiaSearchVideo.setTagsOneOf(binding.sepiaElementOneOfTags.getTags());
|
||||
} else {
|
||||
sepiaSearchVideo.setTagsOneOf(null);
|
||||
}
|
||||
if (sepia_element_all_of_tags.getTags().size() > 0) {
|
||||
sepiaSearchVideo.setTagsAllOf(sepia_element_all_of_tags.getTags());
|
||||
if (binding.sepiaElementAllOfTags.getTags().size() > 0) {
|
||||
sepiaSearchVideo.setTagsAllOf(binding.sepiaElementAllOfTags.getTags());
|
||||
} else {
|
||||
sepiaSearchVideo.setTagsAllOf(null);
|
||||
}
|
||||
@ -322,8 +306,8 @@ public class SepiaSearchActivity extends AppCompatActivity {
|
||||
Fragment fragment = getSupportFragmentManager().findFragmentByTag("SEPIA_SEARCH");
|
||||
if (fragment != null)
|
||||
getSupportFragmentManager().beginTransaction().remove(fragment).commit();
|
||||
filter_elements.setVisibility(View.GONE);
|
||||
sepiaSearchVideo.setSearch(searchBar.getText());
|
||||
binding.filterElements.setVisibility(View.GONE);
|
||||
sepiaSearchVideo.setSearch(binding.searchBar.getText());
|
||||
DisplaySepiaSearchFragment displaySepiaSearchFragment = new DisplaySepiaSearchFragment();
|
||||
Bundle bundle = new Bundle();
|
||||
bundle.putParcelable("sepiaSearchVideo", sepiaSearchVideo);
|
||||
|
@ -288,13 +288,12 @@ public class ShowAccountActivity extends AppCompatActivity {
|
||||
if (position == 0) {
|
||||
DisplayChannelsFragment displayChannelsFragment = new DisplayChannelsFragment();
|
||||
bundle.putString("name", account.getAcct());
|
||||
bundle.putBoolean("myChannels", false);
|
||||
displayChannelsFragment.setArguments(bundle);
|
||||
return displayChannelsFragment;
|
||||
}
|
||||
DisplayVideosFragment displayVideosFragment = new DisplayVideosFragment();
|
||||
bundle.putSerializable(Helper.TIMELINE_TYPE, TimelineVM.TimelineType.ACCOUNT_VIDEOS);
|
||||
bundle.putString("channelId", account.getAcct());
|
||||
bundle.putParcelable("account", account);
|
||||
bundle.putString("peertube_instance", account.getHost());
|
||||
displayVideosFragment.setArguments(bundle);
|
||||
return displayVideosFragment;
|
||||
|
@ -493,7 +493,7 @@ public class ShowChannelActivity extends AppCompatActivity {
|
||||
DisplayVideosFragment displayVideosFragment = new DisplayVideosFragment();
|
||||
Bundle bundle = new Bundle();
|
||||
bundle.putSerializable(Helper.TIMELINE_TYPE, TimelineVM.TimelineType.CHANNEL_VIDEOS);
|
||||
bundle.putString("channelId", channel.getAcct());
|
||||
bundle.putParcelable("channel", channel);
|
||||
bundle.putString("peertube_instance", channel.getHost());
|
||||
bundle.putBoolean("sepia_search", sepiaSearch);
|
||||
displayVideosFragment.setArguments(bundle);
|
||||
|
@ -33,7 +33,7 @@ import java.util.GregorianCalendar;
|
||||
import java.util.Locale;
|
||||
|
||||
import app.fedilab.fedilabtube.client.APIResponse;
|
||||
import app.fedilab.fedilabtube.databinding.ActivitySearchResultBinding;
|
||||
import app.fedilab.fedilabtube.databinding.ActivityVideosTimelineBinding;
|
||||
import app.fedilab.fedilabtube.fragment.DisplayVideosFragment;
|
||||
import app.fedilab.fedilabtube.helper.Helper;
|
||||
import app.fedilab.fedilabtube.viewmodel.TimelineVM;
|
||||
@ -50,7 +50,7 @@ public class VideosTimelineActivity extends AppCompatActivity {
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
|
||||
ActivitySearchResultBinding binding = ActivitySearchResultBinding.inflate(getLayoutInflater());
|
||||
ActivityVideosTimelineBinding binding = ActivityVideosTimelineBinding.inflate(getLayoutInflater());
|
||||
View mainView = binding.getRoot();
|
||||
setContentView(mainView);
|
||||
|
||||
@ -131,6 +131,11 @@ public class VideosTimelineActivity extends AppCompatActivity {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBackPressed() {
|
||||
super.onBackPressed();
|
||||
finish();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onOptionsItemSelected(MenuItem item) {
|
||||
|
@ -0,0 +1,53 @@
|
||||
package app.fedilab.fedilabtube.client;
|
||||
/* 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>. */
|
||||
|
||||
public class MenuItemVideo {
|
||||
|
||||
int icon;
|
||||
String title;
|
||||
actionType action;
|
||||
|
||||
public int getIcon() {
|
||||
return icon;
|
||||
}
|
||||
|
||||
public void setIcon(int icon) {
|
||||
this.icon = icon;
|
||||
}
|
||||
|
||||
public String getTitle() {
|
||||
return title;
|
||||
}
|
||||
|
||||
public void setTitle(String title) {
|
||||
this.title = title;
|
||||
}
|
||||
|
||||
public actionType getAction() {
|
||||
return action;
|
||||
}
|
||||
|
||||
public void setAction(actionType action) {
|
||||
this.action = action;
|
||||
}
|
||||
|
||||
public enum actionType {
|
||||
RESOLUTION,
|
||||
SPEED,
|
||||
CAPTION,
|
||||
AUTONEXT
|
||||
}
|
||||
}
|
@ -70,6 +70,10 @@ public interface PeertubeService {
|
||||
@GET("config/about")
|
||||
Call<InstanceData.InstanceInfo> configAbout();
|
||||
|
||||
//Instance config
|
||||
@GET("config")
|
||||
Call<InstanceData.InstanceConfig> config();
|
||||
|
||||
@GET("{nodeInfoPath}")
|
||||
Call<WellKnownNodeinfo.NodeInfo> getNodeinfo(@Path(value = "nodeInfoPath", encoded = true) String nodeInfoPath);
|
||||
|
||||
@ -120,6 +124,9 @@ public interface PeertubeService {
|
||||
Call<UserMe> verifyCredentials(@Header("Authorization") String credentials);
|
||||
|
||||
|
||||
@GET("users/me/video-quota-used")
|
||||
Call<UserMe.VideoQuota> getVideoQuota(@Header("Authorization") String credentials);
|
||||
|
||||
@FormUrlEncoded
|
||||
@PUT("videos/{id}/watching")
|
||||
Call<String> addToHistory(
|
||||
@ -142,6 +149,13 @@ public interface PeertubeService {
|
||||
@Field("nsfwPolicy") String nsfwPolicy
|
||||
);
|
||||
|
||||
@Multipart
|
||||
@POST("video-channels/{channelHandle}/avatar/pick")
|
||||
Call<UserMe.AvatarResponse> updateChannelProfilePicture(
|
||||
@Header("Authorization") String credentials,
|
||||
@Path("channelHandle") String channelHandle,
|
||||
@Part MultipartBody.Part avatarfile);
|
||||
|
||||
@Multipart
|
||||
@POST("users/me/avatar/pick")
|
||||
Call<UserMe.AvatarResponse> updateProfilePicture(
|
||||
@ -187,7 +201,7 @@ public interface PeertubeService {
|
||||
Call<String> deleteHistory(
|
||||
@Header("Authorization") String credentials);
|
||||
|
||||
//Search
|
||||
//Search videos
|
||||
@GET("search/videos")
|
||||
Call<VideoData> searchVideos(
|
||||
@Header("Authorization") String credentials,
|
||||
@ -195,6 +209,14 @@ public interface PeertubeService {
|
||||
@Query("start") String maxId,
|
||||
@Query("count") String count);
|
||||
|
||||
//Search channels
|
||||
@GET("search/video-channels")
|
||||
Call<ChannelData> searchChannels(
|
||||
@Header("Authorization") String credentials,
|
||||
@Query("search") String search,
|
||||
@Query("searcharget") String searchTarget,
|
||||
@Query("start") String maxId,
|
||||
@Query("count") String count);
|
||||
|
||||
//Search
|
||||
@GET("search/videos")
|
||||
|
@ -19,12 +19,18 @@ import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.content.SharedPreferences;
|
||||
import android.database.sqlite.SQLiteDatabase;
|
||||
import android.net.Uri;
|
||||
import android.os.Handler;
|
||||
import android.os.Looper;
|
||||
import android.webkit.MimeTypeMap;
|
||||
|
||||
import androidx.documentfile.provider.DocumentFile;
|
||||
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.json.JSONException;
|
||||
import org.json.JSONObject;
|
||||
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
@ -559,22 +565,7 @@ public class RetrofitPeertubeAPI {
|
||||
throw error;
|
||||
}
|
||||
if (userSettings.getAvatarfile() != null) {
|
||||
InputStream inputStream = _context.getContentResolver().openInputStream(userSettings.getAvatarfile());
|
||||
ByteArrayOutputStream byteBuffer = new ByteArrayOutputStream();
|
||||
int bufferSize = 1024;
|
||||
byte[] buffer = new byte[bufferSize];
|
||||
|
||||
int len;
|
||||
while ((len = inputStream.read(buffer)) != -1) {
|
||||
byteBuffer.write(buffer, 0, len);
|
||||
}
|
||||
byte[] imageBytes = byteBuffer.toByteArray();
|
||||
String mime = MimeTypeMap.getFileExtensionFromUrl(userSettings.getAvatarfile().toString());
|
||||
if (mime == null || mime.trim().length() == 0) {
|
||||
mime = "png";
|
||||
}
|
||||
RequestBody requestFile = RequestBody.create(MediaType.parse("image/" + mime), imageBytes);
|
||||
MultipartBody.Part bodyThumbnail = MultipartBody.Part.createFormData("avatarfile", userSettings.getFileName(), requestFile);
|
||||
MultipartBody.Part bodyThumbnail = createFile("avatarfile", userSettings.getAvatarfile(), userSettings.getFileName());
|
||||
Call<UserMe.AvatarResponse> updateProfilePicture = peertubeService.updateProfilePicture(getToken(), bodyThumbnail);
|
||||
Response<UserMe.AvatarResponse> responseAvatar = updateProfilePicture.execute();
|
||||
if (response.isSuccessful()) {
|
||||
@ -594,6 +585,29 @@ public class RetrofitPeertubeAPI {
|
||||
return avatarResponse;
|
||||
}
|
||||
|
||||
private MultipartBody.Part createFile(@NotNull String paramName, @NotNull Uri uri, String filename) throws IOException {
|
||||
|
||||
InputStream inputStream = _context.getContentResolver().openInputStream(uri);
|
||||
ByteArrayOutputStream byteBuffer = new ByteArrayOutputStream();
|
||||
int bufferSize = 1024;
|
||||
byte[] buffer = new byte[bufferSize];
|
||||
|
||||
int len;
|
||||
while ((len = inputStream.read(buffer)) != -1) {
|
||||
byteBuffer.write(buffer, 0, len);
|
||||
}
|
||||
byte[] imageBytes = byteBuffer.toByteArray();
|
||||
String mime = MimeTypeMap.getFileExtensionFromUrl(uri.toString());
|
||||
if (mime == null || mime.trim().length() == 0) {
|
||||
mime = "png";
|
||||
}
|
||||
if (filename == null) {
|
||||
filename = "my_image." + mime;
|
||||
}
|
||||
RequestBody requestFile = RequestBody.create(imageBytes, MediaType.parse("image/" + mime));
|
||||
return MultipartBody.Part.createFormData(paramName, filename, requestFile);
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if users via their uris are following the authenticated user
|
||||
*
|
||||
@ -662,6 +676,47 @@ public class RetrofitPeertubeAPI {
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Config of the instance
|
||||
*
|
||||
* @return InstanceConfig
|
||||
*/
|
||||
public InstanceData.InstanceConfig getConfigInstance() {
|
||||
|
||||
PeertubeService peertubeService = init();
|
||||
Call<InstanceData.InstanceConfig> config = peertubeService.config();
|
||||
try {
|
||||
Response<InstanceData.InstanceConfig> response = config.execute();
|
||||
if (response.isSuccessful() && response.body() != null) {
|
||||
return response.body();
|
||||
}
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Get video quota
|
||||
*
|
||||
* @return UserMe.VideoQuota
|
||||
*/
|
||||
public UserMe.VideoQuota getVideoQuota() {
|
||||
|
||||
PeertubeService peertubeService = init();
|
||||
Call<UserMe.VideoQuota> videoQuotaCall = peertubeService.getVideoQuota(getToken());
|
||||
try {
|
||||
Response<UserMe.VideoQuota> response = videoQuotaCall.execute();
|
||||
if (response.isSuccessful() && response.body() != null) {
|
||||
return response.body();
|
||||
}
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns informations about Peertube such privacies, licenses, etc.
|
||||
*
|
||||
@ -876,6 +931,7 @@ public class RetrofitPeertubeAPI {
|
||||
APIResponse apiResponse = new APIResponse();
|
||||
try {
|
||||
Response<VideoData> response = searchVideosCall.execute();
|
||||
|
||||
if (response.isSuccessful() && response.body() != null) {
|
||||
apiResponse.setPeertubes(response.body().data);
|
||||
} else {
|
||||
@ -890,6 +946,34 @@ public class RetrofitPeertubeAPI {
|
||||
return apiResponse;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Retrieves channels search *synchronously*
|
||||
*
|
||||
* @param query String search
|
||||
* @return APIResponse
|
||||
*/
|
||||
public APIResponse searchChannels(String query, String max_id) {
|
||||
PeertubeService peertubeService = init();
|
||||
Call<ChannelData> searchChannelsCall = peertubeService.searchChannels(getToken(), query, "local", max_id, count);
|
||||
APIResponse apiResponse = new APIResponse();
|
||||
try {
|
||||
Response<ChannelData> response = searchChannelsCall.execute();
|
||||
if (response.isSuccessful() && response.body() != null) {
|
||||
apiResponse.setChannels(response.body().data);
|
||||
} else {
|
||||
setError(apiResponse, response.code(), response.errorBody());
|
||||
}
|
||||
} catch (IOException e) {
|
||||
Error error = new Error();
|
||||
error.setError(_context.getString(R.string.toast_error));
|
||||
apiResponse.setError(error);
|
||||
e.printStackTrace();
|
||||
}
|
||||
return apiResponse;
|
||||
}
|
||||
|
||||
|
||||
/***
|
||||
* Verifiy credential of the authenticated user *synchronously*
|
||||
* @return Account
|
||||
@ -949,34 +1033,47 @@ public class RetrofitPeertubeAPI {
|
||||
* @param previewfile File preview
|
||||
* @return APIResponse
|
||||
*/
|
||||
public APIResponse updateVideo(String videoId, VideoParams videoParams, File thumbnail, File previewfile) {
|
||||
public APIResponse updateVideo(String videoId, VideoParams videoParams, Uri thumbnail, Uri previewfile) {
|
||||
PeertubeService peertubeService = init();
|
||||
|
||||
MultipartBody.Part bodyThumbnail = null;
|
||||
MultipartBody.Part bodyPreviewfile = null;
|
||||
try {
|
||||
if (thumbnail != null) {
|
||||
RequestBody requestFile = RequestBody.create(MediaType.parse("multipart/form-data"), thumbnail);
|
||||
bodyThumbnail = MultipartBody.Part.createFormData("image", thumbnail.getName(), requestFile);
|
||||
DocumentFile documentFile = DocumentFile.fromSingleUri(_context, thumbnail);
|
||||
String thumbnailName = null;
|
||||
if (documentFile != null) {
|
||||
thumbnailName = documentFile.getName();
|
||||
}
|
||||
if (previewfile != null) {
|
||||
RequestBody requestFile = RequestBody.create(MediaType.parse("multipart/form-data"), previewfile);
|
||||
bodyPreviewfile = MultipartBody.Part.createFormData("image", previewfile.getName(), requestFile);
|
||||
bodyThumbnail = createFile("avatarfile", thumbnail, thumbnailName);
|
||||
}
|
||||
RequestBody channelId = RequestBody.create(MediaType.parse("text/plain"), videoParams.getChannelId());
|
||||
RequestBody description = RequestBody.create(MediaType.parse("text/plain"), videoParams.getDescription());
|
||||
RequestBody language = RequestBody.create(MediaType.parse("text/plain"), videoParams.getLanguage());
|
||||
RequestBody license = RequestBody.create(MediaType.parse("text/plain"), videoParams.getLicence());
|
||||
RequestBody name = RequestBody.create(MediaType.parse("text/plain"), videoParams.getName());
|
||||
if (previewfile != null && thumbnail != null) {
|
||||
DocumentFile documentFile = DocumentFile.fromSingleUri(_context, thumbnail);
|
||||
String previewfileName = null;
|
||||
if (documentFile != null) {
|
||||
previewfileName = documentFile.getName();
|
||||
}
|
||||
bodyPreviewfile = createFile("image", previewfile, previewfileName);
|
||||
}
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
RequestBody channelId = RequestBody.create(videoParams.getChannelId(), MediaType.parse("text/plain"));
|
||||
RequestBody description = RequestBody.create(videoParams.getDescription(), MediaType.parse("text/plain"));
|
||||
RequestBody language = RequestBody.create(videoParams.getLanguage(), MediaType.parse("text/plain"));
|
||||
RequestBody license = RequestBody.create(videoParams.getLicence(), MediaType.parse("text/plain"));
|
||||
RequestBody name = RequestBody.create(videoParams.getName(), MediaType.parse("text/plain"));
|
||||
|
||||
List<RequestBody> tags = null;
|
||||
if (videoParams.getTags() != null && videoParams.getTags().size() > 0) {
|
||||
tags = new ArrayList<>();
|
||||
for (String tag : videoParams.getTags()) {
|
||||
tags.add(RequestBody.create(MediaType.parse("text/plain"), tag));
|
||||
tags.add(RequestBody.create(tag, MediaType.parse("text/plain")));
|
||||
}
|
||||
}
|
||||
RequestBody support = null;
|
||||
if (videoParams.getSupport() != null) {
|
||||
support = RequestBody.create(MediaType.parse("text/plain"), videoParams.getSupport());
|
||||
support = RequestBody.create(videoParams.getSupport(), MediaType.parse("text/plain"));
|
||||
}
|
||||
|
||||
|
||||
@ -1187,7 +1284,7 @@ public class RetrofitPeertubeAPI {
|
||||
* @param channelParams PlaylistParams
|
||||
* @return APIResponse
|
||||
*/
|
||||
public APIResponse createOrUpdateChannel(ChannelsVM.action apiAction, String channelId, ChannelParams channelParams) {
|
||||
public APIResponse createOrUpdateChannel(ChannelsVM.action apiAction, String channelId, ChannelParams channelParams, Uri avatar) {
|
||||
PeertubeService peertubeService = init();
|
||||
|
||||
APIResponse apiResponse = new APIResponse();
|
||||
@ -1210,6 +1307,21 @@ public class RetrofitPeertubeAPI {
|
||||
setError(apiResponse, response.code(), response.errorBody());
|
||||
}
|
||||
}
|
||||
if (avatar != null) {
|
||||
DocumentFile documentFile = DocumentFile.fromSingleUri(_context, avatar);
|
||||
String avatarfileName = null;
|
||||
if (documentFile != null) {
|
||||
avatarfileName = documentFile.getName();
|
||||
}
|
||||
MultipartBody.Part bodyThumbnail = createFile("avatarfile", avatar, avatarfileName);
|
||||
Call<UserMe.AvatarResponse> updateProfilePicture = peertubeService.updateChannelProfilePicture(getToken(), channelId, bodyThumbnail);
|
||||
Response<UserMe.AvatarResponse> responseAvatar = updateProfilePicture.execute();
|
||||
if (responseAvatar.isSuccessful()) {
|
||||
UserMe.AvatarResponse avatarResponse = responseAvatar.body();
|
||||
} else {
|
||||
setError(apiResponse, responseAvatar.code(), responseAvatar.errorBody());
|
||||
}
|
||||
}
|
||||
} catch (IOException e) {
|
||||
Error error = new Error();
|
||||
error.setError(_context.getString(R.string.toast_error));
|
||||
@ -1333,21 +1445,31 @@ public class RetrofitPeertubeAPI {
|
||||
* @param playlistParams PlaylistParams
|
||||
* @return APIResponse
|
||||
*/
|
||||
public APIResponse createOrUpdatePlaylist(PlaylistsVM.action apiAction, String playlistId, PlaylistParams playlistParams, File thumbnail) {
|
||||
public APIResponse createOrUpdatePlaylist(PlaylistsVM.action apiAction, String playlistId, PlaylistParams playlistParams, Uri thumbnail) {
|
||||
PeertubeService peertubeService = init();
|
||||
|
||||
APIResponse apiResponse = new APIResponse();
|
||||
MultipartBody.Part body = null;
|
||||
|
||||
MultipartBody.Part bodyThumbnail = null;
|
||||
if (thumbnail != null) {
|
||||
RequestBody requestFile = RequestBody.create(MediaType.parse("multipart/form-data"), thumbnail);
|
||||
body = MultipartBody.Part.createFormData("image", thumbnail.getName(), requestFile);
|
||||
DocumentFile documentFile = DocumentFile.fromSingleUri(_context, thumbnail);
|
||||
String avatarfileName = null;
|
||||
if (documentFile != null) {
|
||||
avatarfileName = documentFile.getName();
|
||||
}
|
||||
try {
|
||||
RequestBody displayName = RequestBody.create(MediaType.parse("text/plain"), playlistParams.getDisplayName());
|
||||
RequestBody description = RequestBody.create(MediaType.parse("text/plain"), playlistParams.getDescription());
|
||||
RequestBody channelId = RequestBody.create(MediaType.parse("text/plain"), playlistParams.getVideoChannelId());
|
||||
bodyThumbnail = createFile("thumbnailfile", thumbnail, avatarfileName);
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
try {
|
||||
RequestBody displayName = RequestBody.create(playlistParams.getDisplayName(), MediaType.parse("text/plain"));
|
||||
RequestBody description = RequestBody.create(playlistParams.getDescription(), MediaType.parse("text/plain"));
|
||||
RequestBody channelId = RequestBody.create(playlistParams.getVideoChannelId(), MediaType.parse("text/plain"));
|
||||
if (apiAction == PlaylistsVM.action.CREATE_PLAYLIST) {
|
||||
Call<VideoPlaylistData.VideoPlaylistCreation> stringCall = peertubeService.addPlaylist(getToken(), displayName, description, playlistParams.getPrivacy(), channelId, body);
|
||||
Call<VideoPlaylistData.VideoPlaylistCreation> stringCall = peertubeService.addPlaylist(getToken(), displayName, description, playlistParams.getPrivacy(), channelId, bodyThumbnail);
|
||||
Response<VideoPlaylistData.VideoPlaylistCreation> response = stringCall.execute();
|
||||
if (response.isSuccessful() && response.body() != null) {
|
||||
apiResponse.setActionReturn(response.body().getVideoPlaylist().getId());
|
||||
@ -1356,7 +1478,7 @@ public class RetrofitPeertubeAPI {
|
||||
}
|
||||
|
||||
} else if (apiAction == PlaylistsVM.action.UPDATE_PLAYLIST) {
|
||||
Call<String> stringCall = peertubeService.updatePlaylist(getToken(), playlistId, displayName, description, playlistParams.getPrivacy(), channelId, body);
|
||||
Call<String> stringCall = peertubeService.updatePlaylist(getToken(), playlistId, displayName, description, playlistParams.getPrivacy(), channelId, bodyThumbnail);
|
||||
Response<String> response = stringCall.execute();
|
||||
if (response.isSuccessful()) {
|
||||
apiResponse.setActionReturn(response.body());
|
||||
@ -1621,10 +1743,10 @@ public class RetrofitPeertubeAPI {
|
||||
* @param id String id
|
||||
* @return APIResponse
|
||||
*/
|
||||
public APIResponse getVideos(String id, boolean myVideo) {
|
||||
public APIResponse getVideos(String id, boolean myVideo, boolean canUseToken) {
|
||||
PeertubeService peertubeService = init();
|
||||
Call<VideoData.Video> video;
|
||||
if (myVideo) {
|
||||
if (myVideo || canUseToken) {
|
||||
video = peertubeService.getMyVideo(getToken(), id);
|
||||
} else {
|
||||
video = peertubeService.getVideo(id);
|
||||
@ -1632,12 +1754,40 @@ public class RetrofitPeertubeAPI {
|
||||
APIResponse apiResponse = new APIResponse();
|
||||
try {
|
||||
Response<VideoData.Video> response = video.execute();
|
||||
|
||||
if (response.isSuccessful()) {
|
||||
List<VideoData.Video> videos = new ArrayList<>();
|
||||
videos.add(response.body());
|
||||
apiResponse.setPeertubes(videos);
|
||||
} else {
|
||||
|
||||
if (response.errorBody() != null) {
|
||||
|
||||
String error = response.errorBody().string();
|
||||
if (error.contains("originUrl")) {
|
||||
try {
|
||||
JSONObject jsonObject = new JSONObject(error);
|
||||
List<VideoData.Video> videos = new ArrayList<>();
|
||||
VideoData.Video videoRedirect = new VideoData.Video();
|
||||
videoRedirect.setErrorCode(jsonObject.getInt("errorCode"));
|
||||
videoRedirect.setOriginUrl(jsonObject.getString("originUrl"));
|
||||
videos.add(videoRedirect);
|
||||
apiResponse.setPeertubes(videos);
|
||||
} catch (JSONException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
} else if (error.contains("error")) {
|
||||
try {
|
||||
JSONObject jsonObject = new JSONObject(error);
|
||||
List<VideoData.Video> videos = new ArrayList<>();
|
||||
VideoData.Video videoErrorMessage = new VideoData.Video();
|
||||
videoErrorMessage.setErrorMessage(jsonObject.getString("error"));
|
||||
videos.add(videoErrorMessage);
|
||||
apiResponse.setPeertubes(videos);
|
||||
} catch (JSONException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
} else {
|
||||
Error error = new Error();
|
||||
error.setStatusCode(response.code());
|
||||
if (response.errorBody() != null) {
|
||||
@ -1646,6 +1796,8 @@ public class RetrofitPeertubeAPI {
|
||||
error.setError(_context.getString(R.string.toast_error));
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
} catch (IOException e) {
|
||||
Error error = new Error();
|
||||
error.setError(_context.getString(R.string.toast_error));
|
||||
|
@ -343,5 +343,42 @@ public class InstanceData {
|
||||
parcel.writeString(host);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public static class InstanceConfig {
|
||||
@SerializedName("user")
|
||||
private User user;
|
||||
|
||||
public User getUser() {
|
||||
return user;
|
||||
}
|
||||
|
||||
public void setUser(User user) {
|
||||
this.user = user;
|
||||
}
|
||||
}
|
||||
|
||||
public static class User {
|
||||
@SerializedName("videoQuota")
|
||||
private long videoQuota;
|
||||
@SerializedName("videoQuotaDaily")
|
||||
private long videoQuotaDaily;
|
||||
|
||||
public long getVideoQuota() {
|
||||
return videoQuota;
|
||||
}
|
||||
|
||||
public void setVideoQuota(long videoQuota) {
|
||||
this.videoQuota = videoQuota;
|
||||
}
|
||||
|
||||
public long getVideoQuotaDaily() {
|
||||
return videoQuotaDaily;
|
||||
}
|
||||
|
||||
public void setVideoQuotaDaily(long videoQuotaDaily) {
|
||||
this.videoQuotaDaily = videoQuotaDaily;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -43,6 +43,7 @@ public class VideoData {
|
||||
@SerializedName("data")
|
||||
public List<Video> data;
|
||||
|
||||
|
||||
public static class Video implements Parcelable {
|
||||
public static final Creator<Video> CREATOR = new Creator<Video>() {
|
||||
@Override
|
||||
@ -130,6 +131,9 @@ public class VideoData {
|
||||
@SerializedName("waitTranscoding")
|
||||
private boolean waitTranscoding;
|
||||
private String myRating;
|
||||
private String originUrl;
|
||||
private int errorCode;
|
||||
private String errorMessage;
|
||||
//Dedicated to overview videos to reuse the logic of videos
|
||||
private boolean hasTitle = false;
|
||||
private String title;
|
||||
@ -541,6 +545,22 @@ public class VideoData {
|
||||
this.waitTranscoding = waitTranscoding;
|
||||
}
|
||||
|
||||
public String getOriginUrl() {
|
||||
return originUrl;
|
||||
}
|
||||
|
||||
public void setOriginUrl(String originUrl) {
|
||||
this.originUrl = originUrl;
|
||||
}
|
||||
|
||||
public int getErrorCode() {
|
||||
return errorCode;
|
||||
}
|
||||
|
||||
public void setErrorCode(int errorCode) {
|
||||
this.errorCode = errorCode;
|
||||
}
|
||||
|
||||
public String getMyRating() {
|
||||
return myRating;
|
||||
}
|
||||
@ -581,6 +601,14 @@ public class VideoData {
|
||||
this.playlistExists = playlistExists;
|
||||
}
|
||||
|
||||
public String getErrorMessage() {
|
||||
return errorMessage;
|
||||
}
|
||||
|
||||
public void setErrorMessage(String errorMessage) {
|
||||
this.errorMessage = errorMessage;
|
||||
}
|
||||
|
||||
public UserHistory getUserHistory() {
|
||||
return userHistory;
|
||||
}
|
||||
|
@ -0,0 +1,92 @@
|
||||
package app.fedilab.fedilabtube.client.entities;
|
||||
/* 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>. */
|
||||
|
||||
|
||||
@SuppressWarnings({"unused", "RedundantSuppression"})
|
||||
public class MenuItemView {
|
||||
|
||||
private int id;
|
||||
private String strId;
|
||||
private String label;
|
||||
private boolean selected;
|
||||
|
||||
public MenuItemView() {
|
||||
}
|
||||
|
||||
public MenuItemView(int id, String label) {
|
||||
this.id = id;
|
||||
this.label = label;
|
||||
selected = false;
|
||||
}
|
||||
|
||||
public MenuItemView(int id, String label, boolean selected) {
|
||||
this.id = id;
|
||||
this.label = label;
|
||||
this.selected = selected;
|
||||
}
|
||||
|
||||
public MenuItemView(String strId, String label, boolean selected) {
|
||||
this.strId = strId;
|
||||
this.label = label;
|
||||
this.selected = selected;
|
||||
}
|
||||
|
||||
public MenuItemView(String strId, String label) {
|
||||
this.strId = strId;
|
||||
this.label = label;
|
||||
this.selected = false;
|
||||
}
|
||||
|
||||
public MenuItemView(int id, String strId, String label, boolean selected) {
|
||||
this.id = id;
|
||||
this.strId = strId;
|
||||
this.label = label;
|
||||
this.selected = selected;
|
||||
}
|
||||
|
||||
|
||||
public int getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(int id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getLabel() {
|
||||
return label;
|
||||
}
|
||||
|
||||
public void setLabel(String label) {
|
||||
this.label = label;
|
||||
}
|
||||
|
||||
public boolean isSelected() {
|
||||
return selected;
|
||||
}
|
||||
|
||||
public void setSelected(boolean selected) {
|
||||
this.selected = selected;
|
||||
}
|
||||
|
||||
public String getStrId() {
|
||||
return strId;
|
||||
}
|
||||
|
||||
public void setStrId(String strId) {
|
||||
this.strId = strId;
|
||||
}
|
||||
}
|
@ -66,9 +66,9 @@ public class UserMe {
|
||||
@SerializedName("videoLanguages")
|
||||
private List<String> videoLanguages;
|
||||
@SerializedName("videoQuota")
|
||||
private String videoQuota;
|
||||
private long videoQuota;
|
||||
@SerializedName("videoQuotaDaily")
|
||||
private String videoQuotaDaily;
|
||||
private long videoQuotaDaily;
|
||||
@SerializedName("videosHistoryEnabled")
|
||||
private boolean videosHistoryEnabled;
|
||||
@SerializedName("webTorrentEnabled")
|
||||
@ -226,19 +226,19 @@ public class UserMe {
|
||||
this.videoLanguages = videoLanguages;
|
||||
}
|
||||
|
||||
public String getVideoQuota() {
|
||||
public long getVideoQuota() {
|
||||
return videoQuota;
|
||||
}
|
||||
|
||||
public void setVideoQuota(String videoQuota) {
|
||||
public void setVideoQuota(long videoQuota) {
|
||||
this.videoQuota = videoQuota;
|
||||
}
|
||||
|
||||
public String getVideoQuotaDaily() {
|
||||
public long getVideoQuotaDaily() {
|
||||
return videoQuotaDaily;
|
||||
}
|
||||
|
||||
public void setVideoQuotaDaily(String videoQuotaDaily) {
|
||||
public void setVideoQuotaDaily(long videoQuotaDaily) {
|
||||
this.videoQuotaDaily = videoQuotaDaily;
|
||||
}
|
||||
|
||||
@ -279,4 +279,27 @@ public class UserMe {
|
||||
this.avatar = avatar;
|
||||
}
|
||||
}
|
||||
|
||||
public static class VideoQuota {
|
||||
@SerializedName("videoQuotaUsed")
|
||||
private long videoQuotaUsed;
|
||||
@SerializedName("videoQuotaUsedDaily")
|
||||
private long videoQuotaUsedDaily;
|
||||
|
||||
public long getVideoQuotaUsed() {
|
||||
return videoQuotaUsed;
|
||||
}
|
||||
|
||||
public void setVideoQuotaUsed(long videoQuotaUsed) {
|
||||
this.videoQuotaUsed = videoQuotaUsed;
|
||||
}
|
||||
|
||||
public long getVideoQuotaUsedDaily() {
|
||||
return videoQuotaUsedDaily;
|
||||
}
|
||||
|
||||
public void setVideoQuotaUsedDaily(long videoQuotaUsedDaily) {
|
||||
this.videoQuotaUsedDaily = videoQuotaUsedDaily;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -19,19 +19,13 @@ import android.graphics.Color;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.LinearLayout;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.core.content.ContextCompat;
|
||||
import androidx.core.graphics.ColorUtils;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import app.fedilab.fedilabtube.R;
|
||||
import app.fedilab.fedilabtube.client.data.ChannelData;
|
||||
import app.fedilab.fedilabtube.databinding.DrawerHorizontalAccountBinding;
|
||||
import app.fedilab.fedilabtube.helper.Helper;
|
||||
|
||||
|
||||
@ -50,8 +44,8 @@ public class AccountsHorizontalListAdapter extends RecyclerView.Adapter<Recycler
|
||||
@Override
|
||||
public RecyclerView.ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
|
||||
context = parent.getContext();
|
||||
LayoutInflater layoutInflater = LayoutInflater.from(context);
|
||||
return new ViewHolder(layoutInflater.inflate(R.layout.drawer_horizontal_account, parent, false));
|
||||
DrawerHorizontalAccountBinding itemBinding = DrawerHorizontalAccountBinding.inflate(LayoutInflater.from(parent.getContext()), parent, false);
|
||||
return new ViewHolder(itemBinding);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -60,17 +54,17 @@ public class AccountsHorizontalListAdapter extends RecyclerView.Adapter<Recycler
|
||||
final ChannelData.Channel channel = channels.get(position);
|
||||
|
||||
if (channel.getDisplayName() != null && !channel.getDisplayName().trim().equals(""))
|
||||
holder.account_dn.setText(channel.getDisplayName());
|
||||
holder.binding.accountDn.setText(channel.getDisplayName());
|
||||
else
|
||||
holder.account_dn.setText(channel.getName().replace("@", ""));
|
||||
holder.binding.accountDn.setText(channel.getName().replace("@", ""));
|
||||
|
||||
//Profile picture
|
||||
Helper.loadGiF(context, channel.getAvatar() != null ? channel.getAvatar().getPath() : null, holder.account_pp, 270);
|
||||
Helper.loadGiF(context, channel.getAvatar() != null ? channel.getAvatar().getPath() : null, holder.binding.accountPp, 270);
|
||||
|
||||
if (channel.isSelected()) {
|
||||
holder.main_container.setBackgroundColor(ColorUtils.setAlphaComponent(ContextCompat.getColor(context, Helper.getColorAccent()), 50));
|
||||
holder.binding.mainContainer.setBackgroundColor(ColorUtils.setAlphaComponent(ContextCompat.getColor(context, Helper.getColorAccent()), 50));
|
||||
} else {
|
||||
holder.main_container.setBackgroundColor(Color.TRANSPARENT);
|
||||
holder.binding.mainContainer.setBackgroundColor(Color.TRANSPARENT);
|
||||
}
|
||||
|
||||
}
|
||||
@ -87,27 +81,24 @@ public class AccountsHorizontalListAdapter extends RecyclerView.Adapter<Recycler
|
||||
|
||||
|
||||
public interface EventListener {
|
||||
void click(String forAccount);
|
||||
void click(ChannelData.Channel channel);
|
||||
}
|
||||
|
||||
|
||||
private class ViewHolder extends RecyclerView.ViewHolder implements View.OnClickListener {
|
||||
ImageView account_pp;
|
||||
TextView account_dn;
|
||||
LinearLayout main_container;
|
||||
DrawerHorizontalAccountBinding binding;
|
||||
|
||||
ViewHolder(DrawerHorizontalAccountBinding itemView) {
|
||||
super(itemView.getRoot());
|
||||
binding = itemView;
|
||||
itemView.getRoot().setOnClickListener(this);
|
||||
|
||||
ViewHolder(View itemView) {
|
||||
super(itemView);
|
||||
itemView.setOnClickListener(this);
|
||||
account_pp = itemView.findViewById(R.id.account_pp);
|
||||
account_dn = itemView.findViewById(R.id.account_dn);
|
||||
main_container = itemView.findViewById(R.id.main_container);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
ChannelData.Channel channel = channels.get(getAdapterPosition());
|
||||
listener.click(channel.getAcct());
|
||||
listener.click(channel);
|
||||
for (ChannelData.Channel acc : channels) {
|
||||
acc.setSelected(acc.getId().compareTo(channel.getId()) == 0);
|
||||
}
|
||||
|
@ -17,6 +17,7 @@ package app.fedilab.fedilabtube.drawer;
|
||||
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;
|
||||
@ -45,15 +46,13 @@ import app.fedilab.fedilabtube.helper.Helper;
|
||||
public class ChannelListAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> {
|
||||
|
||||
private final List<Channel> channels;
|
||||
private final boolean myChannel;
|
||||
public AllChannelRemoved allChannelRemoved;
|
||||
public EditAlertDialog editAlertDialog;
|
||||
private Context context;
|
||||
|
||||
|
||||
public ChannelListAdapter(List<Channel> channels, boolean myChannel) {
|
||||
public ChannelListAdapter(List<Channel> channels) {
|
||||
this.channels = channels;
|
||||
this.myChannel = myChannel;
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@ -77,7 +76,7 @@ public class ChannelListAdapter extends RecyclerView.Adapter<RecyclerView.ViewHo
|
||||
//Profile picture
|
||||
Helper.loadGiF(context, channel.getAvatar() != null ? channel.getAvatar().getPath() : null, holder.account_pp);
|
||||
|
||||
if (!this.myChannel) {
|
||||
if (!isMyChannel(channel)) {
|
||||
holder.more_actions.setVisibility(View.GONE);
|
||||
}
|
||||
holder.more_actions.setOnClickListener(view -> {
|
||||
@ -132,6 +131,20 @@ public class ChannelListAdapter extends RecyclerView.Adapter<RecyclerView.ViewHo
|
||||
|
||||
}
|
||||
|
||||
|
||||
private boolean isMyChannel(Channel channel) {
|
||||
SharedPreferences sharedpreferences = context.getSharedPreferences(Helper.APP_PREFS, Context.MODE_PRIVATE);
|
||||
String channeIdOwner = channel.getOwnerAccount().getId();
|
||||
String channeInstanceOwner = channel.getOwnerAccount().getHost();
|
||||
String instanceShar = sharedpreferences.getString(Helper.PREF_INSTANCE, null);
|
||||
String userIdShar = sharedpreferences.getString(Helper.PREF_KEY_ID, null);
|
||||
if (channeIdOwner != null && channeInstanceOwner != null && instanceShar != null && userIdShar != null) {
|
||||
return channeIdOwner.compareTo(userIdShar) == 0 && channeInstanceOwner.compareTo(instanceShar) == 0;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getItemId(int position) {
|
||||
return position;
|
||||
|
@ -33,9 +33,7 @@ import android.view.LayoutInflater;
|
||||
import android.view.MotionEvent;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.Button;
|
||||
import android.widget.EditText;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.LinearLayout;
|
||||
import android.widget.TextView;
|
||||
import android.widget.Toast;
|
||||
@ -59,6 +57,7 @@ import app.fedilab.fedilabtube.client.APIResponse;
|
||||
import app.fedilab.fedilabtube.client.RetrofitPeertubeAPI;
|
||||
import app.fedilab.fedilabtube.client.data.CommentData.Comment;
|
||||
import app.fedilab.fedilabtube.client.entities.Report;
|
||||
import app.fedilab.fedilabtube.databinding.DrawerCommentBinding;
|
||||
import app.fedilab.fedilabtube.helper.CommentDecorationHelper;
|
||||
import app.fedilab.fedilabtube.helper.EmojiHelper;
|
||||
import app.fedilab.fedilabtube.helper.Helper;
|
||||
@ -78,12 +77,14 @@ public class CommentListAdapter extends RecyclerView.Adapter<RecyclerView.ViewHo
|
||||
public AllCommentRemoved allCommentRemoved;
|
||||
boolean isVideoOwner;
|
||||
private Context context;
|
||||
private final String instance;
|
||||
|
||||
public CommentListAdapter(List<Comment> comments, boolean isVideoOwner, boolean isThread) {
|
||||
public CommentListAdapter(List<Comment> comments, boolean isVideoOwner, boolean isThread, String instance) {
|
||||
this.comments = comments;
|
||||
commentListAdapter = this;
|
||||
this.isVideoOwner = isVideoOwner;
|
||||
this.isThread = isThread;
|
||||
this.instance = instance;
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -102,10 +103,11 @@ public class CommentListAdapter extends RecyclerView.Adapter<RecyclerView.ViewHo
|
||||
public RecyclerView.ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
|
||||
|
||||
context = parent.getContext();
|
||||
LayoutInflater layoutInflater = LayoutInflater.from(this.context);
|
||||
return new ViewHolder(layoutInflater.inflate(R.layout.drawer_comment, parent, false));
|
||||
DrawerCommentBinding itemBinding = DrawerCommentBinding.inflate(LayoutInflater.from(parent.getContext()), parent, false);
|
||||
return new ViewHolder(itemBinding);
|
||||
}
|
||||
|
||||
|
||||
@SuppressLint({"SetJavaScriptEnabled", "ClickableViewAccessibility"})
|
||||
@Override
|
||||
public void onBindViewHolder(@NonNull final RecyclerView.ViewHolder viewHolder, int i) {
|
||||
@ -119,23 +121,23 @@ public class CommentListAdapter extends RecyclerView.Adapter<RecyclerView.ViewHo
|
||||
|
||||
if (comment == null)
|
||||
return;
|
||||
holder.main_container.setTag(i);
|
||||
holder.binding.mainContainer.setTag(i);
|
||||
|
||||
LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(
|
||||
LinearLayout.LayoutParams.MATCH_PARENT,
|
||||
LinearLayout.LayoutParams.WRAP_CONTENT
|
||||
);
|
||||
|
||||
holder.binding.decorationContainer.removeAllViews();
|
||||
if (comment.isReply()) {
|
||||
int ident = CommentDecorationHelper.getIndentation(comment.getInReplyToCommentId(), comments);
|
||||
holder.decoration.setVisibility(View.VISIBLE);
|
||||
params.setMargins((int) Helper.convertDpToPixel(ident * 15, context), 0, 0, 0);
|
||||
} else {
|
||||
holder.decoration.setVisibility(View.GONE);
|
||||
params.setMargins(0, 0, 0, 0);
|
||||
for (int j = 0; j <= ident; j++) {
|
||||
View view = new View(context);
|
||||
LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(1, LinearLayout.LayoutParams.MATCH_PARENT);
|
||||
params.setMargins((int) Helper.convertDpToPixel(5, context), 0, 0, 0);
|
||||
view.setBackgroundResource(R.color.colorAccent);
|
||||
view.setLayoutParams(params);
|
||||
holder.binding.decorationContainer.addView(view, 0);
|
||||
}
|
||||
holder.main_container.setLayoutParams(params);
|
||||
holder.more_actions.setOnClickListener(view -> {
|
||||
PopupMenu popup = new PopupMenu(context, holder.more_actions);
|
||||
}
|
||||
holder.binding.moreActions.setOnClickListener(view -> {
|
||||
PopupMenu popup = new PopupMenu(context, holder.binding.moreActions);
|
||||
popup.getMenuInflater()
|
||||
.inflate(R.menu.comment_menu, popup.getMenu());
|
||||
if (!Helper.isOwner(context, comment.getAccount())) {
|
||||
@ -217,7 +219,7 @@ public class CommentListAdapter extends RecyclerView.Adapter<RecyclerView.ViewHo
|
||||
});
|
||||
popup.show();
|
||||
});
|
||||
holder.comment_content.setOnTouchListener((view, motionEvent) -> {
|
||||
holder.binding.commentContent.setOnTouchListener((view, motionEvent) -> {
|
||||
if (motionEvent.getAction() == MotionEvent.ACTION_UP && !view.hasFocus()) {
|
||||
try {
|
||||
view.requestFocus();
|
||||
@ -232,22 +234,22 @@ public class CommentListAdapter extends RecyclerView.Adapter<RecyclerView.ViewHo
|
||||
commentSpan = Html.fromHtml(EmojiHelper.shortnameToUnicode(comment.getText()), Html.FROM_HTML_MODE_COMPACT);
|
||||
else
|
||||
commentSpan = Html.fromHtml(EmojiHelper.shortnameToUnicode(comment.getText()));
|
||||
holder.comment_content.setText(commentSpan, TextView.BufferType.SPANNABLE);
|
||||
holder.binding.commentContent.setText(commentSpan, TextView.BufferType.SPANNABLE);
|
||||
|
||||
holder.comment_content.setMovementMethod(LinkMovementMethod.getInstance());
|
||||
holder.binding.commentContent.setMovementMethod(LinkMovementMethod.getInstance());
|
||||
|
||||
holder.comment_account_displayname.setText(comment.getAccount().getDisplayName());
|
||||
holder.binding.commentAccountDisplayname.setText(comment.getAccount().getDisplayName());
|
||||
|
||||
|
||||
if (context instanceof PeertubeActivity && !isThread) {
|
||||
holder.main_container.setOnClickListener(v -> ((PeertubeActivity) context).openCommentThread(comment));
|
||||
holder.comment_content.setOnClickListener(v -> ((PeertubeActivity) context).openCommentThread(comment));
|
||||
holder.binding.mainContainer.setOnClickListener(v -> ((PeertubeActivity) context).openCommentThread(comment));
|
||||
holder.binding.commentContent.setOnClickListener(v -> ((PeertubeActivity) context).openCommentThread(comment));
|
||||
}
|
||||
if (comment.getTotalReplies() > 0) {
|
||||
holder.number_of_replies.setVisibility(View.VISIBLE);
|
||||
holder.number_of_replies.setText(context.getResources().getQuantityString(R.plurals.number_of_replies, comment.getTotalReplies(), comment.getTotalReplies()));
|
||||
holder.binding.numberOfReplies.setVisibility(View.VISIBLE);
|
||||
holder.binding.numberOfReplies.setText(context.getResources().getQuantityString(R.plurals.number_of_replies, comment.getTotalReplies(), comment.getTotalReplies()));
|
||||
} else {
|
||||
holder.number_of_replies.setVisibility(View.GONE);
|
||||
holder.binding.numberOfReplies.setVisibility(View.GONE);
|
||||
}
|
||||
|
||||
if (comment.getAccount() != null) {
|
||||
@ -263,15 +265,20 @@ public class CommentListAdapter extends RecyclerView.Adapter<RecyclerView.ViewHo
|
||||
wordtoSpan.setSpan(new ForegroundColorSpan(ContextCompat.getColor(context, android.R.color.darker_gray)), matchStart, matchEnd, Spanned.SPAN_INCLUSIVE_EXCLUSIVE);
|
||||
}
|
||||
}
|
||||
holder.comment_account_username.setText(wordtoSpan);
|
||||
holder.binding.commentAccountUsername.setText(wordtoSpan);
|
||||
}
|
||||
|
||||
holder.comment_date.setText(Helper.dateDiff(context, comment.getCreatedAt()));
|
||||
holder.binding.commentDate.setText(Helper.dateDiff(context, comment.getCreatedAt()));
|
||||
|
||||
String avatarUrl;
|
||||
if (instance != null) {
|
||||
avatarUrl = comment.getAccount().getAvatar() != null ? "https://" + instance + comment.getAccount().getAvatar().getPath() : null;
|
||||
} else {
|
||||
avatarUrl = comment.getAccount().getAvatar() != null ? comment.getAccount().getAvatar().getPath() : null;
|
||||
}
|
||||
Helper.loadGiF(context, avatarUrl, holder.binding.commentAccountProfile);
|
||||
|
||||
Helper.loadGiF(context, comment.getAccount().getAvatar() != null ? comment.getAccount().getAvatar().getPath() : null, holder.comment_account_profile);
|
||||
|
||||
holder.comment_account_profile.setOnClickListener(v -> {
|
||||
holder.binding.commentAccountProfile.setOnClickListener(v -> {
|
||||
Bundle b = new Bundle();
|
||||
Intent intent = new Intent(context, ShowAccountActivity.class);
|
||||
b.putParcelable("account", comment.getAccount());
|
||||
@ -280,17 +287,17 @@ public class CommentListAdapter extends RecyclerView.Adapter<RecyclerView.ViewHo
|
||||
context.startActivity(intent);
|
||||
});
|
||||
if (comment.isReply()) {
|
||||
holder.replyButton.setVisibility(View.VISIBLE);
|
||||
holder.binding.replyButton.setVisibility(View.VISIBLE);
|
||||
} else {
|
||||
holder.replyButton.setVisibility(View.GONE);
|
||||
holder.binding.replyButton.setVisibility(View.GONE);
|
||||
}
|
||||
if (i == 0 && isThread) {
|
||||
holder.post_reply_button.setVisibility(View.VISIBLE);
|
||||
holder.binding.postReplyButton.setVisibility(View.VISIBLE);
|
||||
} else {
|
||||
holder.post_reply_button.setVisibility(View.GONE);
|
||||
holder.binding.postReplyButton.setVisibility(View.GONE);
|
||||
}
|
||||
holder.post_reply_button.setOnClickListener(v -> ((PeertubeActivity) context).openPostComment(comment, i));
|
||||
holder.replyButton.setOnClickListener(v -> ((PeertubeActivity) context).openPostComment(comment, i));
|
||||
holder.binding.postReplyButton.setOnClickListener(v -> ((PeertubeActivity) context).openPostComment(comment, i));
|
||||
holder.binding.replyButton.setOnClickListener(v -> ((PeertubeActivity) context).openPostComment(comment, i));
|
||||
}
|
||||
|
||||
public void manageVIewPostActions(RetrofitPeertubeAPI.ActionType statusAction, int i, APIResponse apiResponse) {
|
||||
@ -351,40 +358,15 @@ public class CommentListAdapter extends RecyclerView.Adapter<RecyclerView.ViewHo
|
||||
void onAllCommentRemoved();
|
||||
}
|
||||
|
||||
|
||||
static class ViewHolder extends RecyclerView.ViewHolder {
|
||||
DrawerCommentBinding binding;
|
||||
|
||||
TextView comment_content;
|
||||
TextView comment_account_username;
|
||||
TextView comment_account_displayname;
|
||||
ImageView comment_account_profile;
|
||||
TextView comment_date, replyButton;
|
||||
LinearLayout main_container;
|
||||
TextView more_actions, number_of_replies;
|
||||
Button post_reply_button;
|
||||
View decoration;
|
||||
|
||||
@SuppressLint("SetJavaScriptEnabled")
|
||||
ViewHolder(View itemView) {
|
||||
super(itemView);
|
||||
comment_content = itemView.findViewById(R.id.comment_content);
|
||||
comment_account_username = itemView.findViewById(R.id.comment_account_username);
|
||||
comment_account_profile = itemView.findViewById(R.id.comment_account_profile);
|
||||
comment_account_displayname = itemView.findViewById(R.id.comment_account_displayname);
|
||||
comment_date = itemView.findViewById(R.id.comment_date);
|
||||
main_container = itemView.findViewById(R.id.main_container);
|
||||
more_actions = itemView.findViewById(R.id.more_actions);
|
||||
number_of_replies = itemView.findViewById(R.id.number_of_replies);
|
||||
replyButton = itemView.findViewById(R.id.replyButton);
|
||||
decoration = itemView.findViewById(R.id.decoration);
|
||||
post_reply_button = itemView.findViewById(R.id.post_reply_button);
|
||||
|
||||
ViewHolder(DrawerCommentBinding itemView) {
|
||||
super(itemView.getRoot());
|
||||
binding = itemView;
|
||||
}
|
||||
|
||||
public View getView() {
|
||||
return itemView;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
@ -38,7 +38,7 @@ import app.fedilab.fedilabtube.client.data.InstanceData.Instance;
|
||||
import app.fedilab.fedilabtube.helper.RoundedBackgroundSpan;
|
||||
|
||||
import static android.app.Activity.RESULT_OK;
|
||||
import static app.fedilab.fedilabtube.MainActivity.peertubeInformation;
|
||||
import static app.fedilab.fedilabtube.helper.Helper.peertubeInformation;
|
||||
|
||||
|
||||
public class InstanceAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> {
|
||||
|
@ -0,0 +1,87 @@
|
||||
package app.fedilab.fedilabtube.drawer;
|
||||
/* 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.view.LayoutInflater;
|
||||
import android.view.ViewGroup;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import app.fedilab.fedilabtube.client.MenuItemVideo;
|
||||
import app.fedilab.fedilabtube.databinding.DrawerMenuBinding;
|
||||
|
||||
|
||||
public class MenuAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> {
|
||||
|
||||
|
||||
private final List<MenuItemVideo> menuItemVideos;
|
||||
public ItemClicked itemClicked;
|
||||
|
||||
|
||||
public MenuAdapter(List<MenuItemVideo> menuItemVideos) {
|
||||
this.menuItemVideos = menuItemVideos;
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getItemId(int position) {
|
||||
return position;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getItemCount() {
|
||||
return menuItemVideos.size();
|
||||
}
|
||||
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public RecyclerView.ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
|
||||
DrawerMenuBinding itemBinding = DrawerMenuBinding.inflate(LayoutInflater.from(parent.getContext()), parent, false);
|
||||
return new ViewHolder(itemBinding);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBindViewHolder(@NonNull final RecyclerView.ViewHolder viewHolder, int i) {
|
||||
|
||||
final ViewHolder holder = (ViewHolder) viewHolder;
|
||||
|
||||
final MenuItemVideo menuItemVideo = menuItemVideos.get(i);
|
||||
|
||||
holder.binding.menuIcon.setImageResource(menuItemVideo.getIcon());
|
||||
holder.binding.title.setText(menuItemVideo.getTitle());
|
||||
holder.binding.itemMenuContainer.setOnClickListener(v -> itemClicked.onItemClicked(menuItemVideo.getAction()));
|
||||
|
||||
}
|
||||
|
||||
public interface ItemClicked {
|
||||
void onItemClicked(MenuItemVideo.actionType actionType);
|
||||
}
|
||||
|
||||
static class ViewHolder extends RecyclerView.ViewHolder {
|
||||
|
||||
DrawerMenuBinding binding;
|
||||
|
||||
ViewHolder(DrawerMenuBinding itemView) {
|
||||
super(itemView.getRoot());
|
||||
binding = itemView;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,89 @@
|
||||
package app.fedilab.fedilabtube.drawer;
|
||||
/* 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.view.LayoutInflater;
|
||||
import android.view.ViewGroup;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import app.fedilab.fedilabtube.client.MenuItemVideo;
|
||||
import app.fedilab.fedilabtube.client.entities.MenuItemView;
|
||||
import app.fedilab.fedilabtube.databinding.DrawerMenuItemBinding;
|
||||
|
||||
|
||||
public class MenuItemAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> {
|
||||
|
||||
private final List<MenuItemView> items;
|
||||
public ItemAction itemAction;
|
||||
MenuItemVideo.actionType actionType;
|
||||
|
||||
public MenuItemAdapter(MenuItemVideo.actionType actionType, List<MenuItemView> items) {
|
||||
this.items = items;
|
||||
this.actionType = actionType;
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getItemId(int position) {
|
||||
return position;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getItemCount() {
|
||||
return items.size();
|
||||
}
|
||||
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public RecyclerView.ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
|
||||
DrawerMenuItemBinding itemBinding = DrawerMenuItemBinding.inflate(LayoutInflater.from(parent.getContext()), parent, false);
|
||||
return new ViewHolder(itemBinding);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBindViewHolder(@NonNull final RecyclerView.ViewHolder viewHolder, int i) {
|
||||
|
||||
|
||||
final ViewHolder holder = (ViewHolder) viewHolder;
|
||||
|
||||
final MenuItemView item = items.get(i);
|
||||
|
||||
holder.binding.title.setText(item.getLabel());
|
||||
holder.binding.radio.setChecked(item.isSelected());
|
||||
holder.binding.itemMenuContainer.setOnClickListener(v -> itemAction.which(actionType, item));
|
||||
holder.binding.radio.setOnClickListener(v -> itemAction.which(actionType, item));
|
||||
}
|
||||
|
||||
public interface ItemAction {
|
||||
void which(MenuItemVideo.actionType actionType, MenuItemView item);
|
||||
}
|
||||
|
||||
static class ViewHolder extends RecyclerView.ViewHolder {
|
||||
|
||||
DrawerMenuItemBinding binding;
|
||||
|
||||
ViewHolder(DrawerMenuItemBinding itemView) {
|
||||
super(itemView.getRoot());
|
||||
binding = itemView;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
@ -14,10 +14,12 @@ 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.annotation.SuppressLint;
|
||||
import android.app.Activity;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.content.SharedPreferences;
|
||||
import android.graphics.drawable.Drawable;
|
||||
import android.os.Bundle;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
@ -25,17 +27,24 @@ import android.view.ViewGroup;
|
||||
import android.widget.EditText;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.LinearLayout;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.appcompat.app.AlertDialog;
|
||||
import androidx.appcompat.widget.PopupMenu;
|
||||
import androidx.constraintlayout.widget.ConstraintLayout;
|
||||
import androidx.lifecycle.LifecycleOwner;
|
||||
import androidx.lifecycle.ViewModelProvider;
|
||||
import androidx.lifecycle.ViewModelStoreOwner;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.bumptech.glide.Glide;
|
||||
import com.bumptech.glide.RequestBuilder;
|
||||
import com.bumptech.glide.load.resource.bitmap.CenterCrop;
|
||||
import com.bumptech.glide.load.resource.bitmap.RoundedCorners;
|
||||
import com.bumptech.glide.request.RequestOptions;
|
||||
import com.bumptech.glide.request.target.CustomTarget;
|
||||
import com.bumptech.glide.request.transition.Transition;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
@ -50,11 +59,13 @@ import app.fedilab.fedilabtube.client.data.PlaylistData;
|
||||
import app.fedilab.fedilabtube.client.data.VideoData;
|
||||
import app.fedilab.fedilabtube.client.entities.PlaylistExist;
|
||||
import app.fedilab.fedilabtube.client.entities.Report;
|
||||
import app.fedilab.fedilabtube.databinding.DrawerPeertubeBinding;
|
||||
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;
|
||||
import jp.wasabeef.glide.transformations.BlurTransformation;
|
||||
|
||||
import static app.fedilab.fedilabtube.client.RetrofitPeertubeAPI.ActionType.FOLLOW;
|
||||
import static app.fedilab.fedilabtube.client.RetrofitPeertubeAPI.ActionType.UNFOLLOW;
|
||||
@ -87,8 +98,8 @@ public class PeertubeAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolde
|
||||
@Override
|
||||
public RecyclerView.ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
|
||||
context = parent.getContext();
|
||||
LayoutInflater layoutInflater = LayoutInflater.from(context);
|
||||
return new ViewHolder(layoutInflater.inflate(R.layout.drawer_peertube, parent, false));
|
||||
DrawerPeertubeBinding itemBinding = DrawerPeertubeBinding.inflate(LayoutInflater.from(parent.getContext()), parent, false);
|
||||
return new ViewHolder(itemBinding);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -120,43 +131,43 @@ public class PeertubeAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolde
|
||||
instance = video.getAccount().getHost();
|
||||
}
|
||||
|
||||
holder.peertube_account_name.setText(video.getChannel().getAcct());
|
||||
Helper.loadGiF(context, instance, video.getChannel().getAvatar() != null ? video.getChannel().getAvatar().getPath() : null, holder.peertube_profile);
|
||||
holder.binding.peertubeAccountName.setText(video.getChannel().getAcct());
|
||||
Helper.loadGiF(context, instance, video.getChannel().getAvatar() != null ? video.getChannel().getAvatar().getPath() : null, holder.binding.peertubeProfile);
|
||||
|
||||
holder.peertube_title.setText(video.getName());
|
||||
holder.peertube_duration.setText(Helper.secondsToString(video.getDuration()));
|
||||
holder.peertube_date.setText(String.format(" - %s", Helper.dateDiff(context, video.getCreatedAt())));
|
||||
holder.peertube_views.setText(context.getString(R.string.number_view_video, Helper.withSuffix(video.getViews())));
|
||||
holder.binding.peertubeTitle.setText(video.getName());
|
||||
holder.binding.peertubeDuration.setText(Helper.secondsToString(video.getDuration()));
|
||||
holder.binding.peertubeDate.setText(String.format(" - %s", Helper.dateDiff(context, video.getCreatedAt())));
|
||||
holder.binding.peertubeViews.setText(context.getString(R.string.number_view_video, Helper.withSuffix(video.getViews())));
|
||||
|
||||
boolean blur = sharedpreferences.getString(context.getString(R.string.set_video_sensitive_choice), Helper.BLUR).compareTo("blur") == 0 && video.isNsfw();
|
||||
if (videoInList) {
|
||||
Helper.loadGiF(context, instance, video.getThumbnailPath(), holder.peertube_video_image_small, blur);
|
||||
holder.peertube_video_image_small.setVisibility(View.VISIBLE);
|
||||
holder.preview_container.setVisibility(View.GONE);
|
||||
Helper.loadGiF(context, instance, video.getThumbnailPath(), holder.binding.peertubeVideoImageSmall, blur);
|
||||
holder.binding.peertubeVideoImageSmall.setVisibility(View.VISIBLE);
|
||||
holder.binding.previewContainer.setVisibility(View.GONE);
|
||||
} else {
|
||||
Helper.loadGiF(context, instance, video.getThumbnailPath(), holder.peertube_video_image, blur);
|
||||
holder.peertube_video_image_small.setVisibility(View.GONE);
|
||||
holder.preview_container.setVisibility(View.VISIBLE);
|
||||
loadImage(holder.binding.peertubeVideoImage, instance, video.getPreviewPath(), video.getThumbnailPath(), blur);
|
||||
holder.binding.peertubeVideoImageSmall.setVisibility(View.GONE);
|
||||
holder.binding.previewContainer.setVisibility(View.VISIBLE);
|
||||
}
|
||||
|
||||
//For Overview Videos: boolean values for displaying title is managed in the fragment
|
||||
if (video.isHasTitle()) {
|
||||
holder.header_title.setVisibility(View.VISIBLE);
|
||||
holder.binding.headerTitle.setVisibility(View.VISIBLE);
|
||||
switch (video.getTitleType()) {
|
||||
case TAG:
|
||||
holder.header_title.setText(String.format("#%s", video.getTitle()));
|
||||
holder.binding.headerTitle.setText(String.format("#%s", video.getTitle()));
|
||||
break;
|
||||
case CHANNEL:
|
||||
case CATEGORY:
|
||||
holder.header_title.setText(String.format("%s", video.getTitle()));
|
||||
holder.binding.headerTitle.setText(String.format("%s", video.getTitle()));
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
holder.header_title.setVisibility(View.GONE);
|
||||
holder.binding.headerTitle.setVisibility(View.GONE);
|
||||
}
|
||||
|
||||
if (!ownVideos) {
|
||||
holder.peertube_profile.setOnClickListener(v -> {
|
||||
holder.binding.peertubeProfile.setOnClickListener(v -> {
|
||||
Intent intent = new Intent(context, ShowChannelActivity.class);
|
||||
Bundle b = new Bundle();
|
||||
b.putParcelable("channel", video.getChannel());
|
||||
@ -170,8 +181,8 @@ public class PeertubeAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolde
|
||||
}
|
||||
|
||||
|
||||
holder.more_actions.setOnClickListener(view -> {
|
||||
PopupMenu popup = new PopupMenu(context, holder.more_actions);
|
||||
holder.binding.moreActions.setOnClickListener(view -> {
|
||||
PopupMenu popup = new PopupMenu(context, holder.binding.moreActions);
|
||||
popup.getMenuInflater()
|
||||
.inflate(R.menu.video_drawer_menu, popup.getMenu());
|
||||
if (timelineType == MY_VIDEOS) {
|
||||
@ -256,7 +267,7 @@ public class PeertubeAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolde
|
||||
});
|
||||
popup.show();
|
||||
});
|
||||
holder.bottom_container.setOnClickListener(v -> {
|
||||
holder.binding.bottomContainer.setOnClickListener(v -> {
|
||||
Intent intent = new Intent(context, PeertubeActivity.class);
|
||||
Bundle b = new Bundle();
|
||||
b.putString("video_id", video.getId());
|
||||
@ -270,7 +281,7 @@ public class PeertubeAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolde
|
||||
intent.putExtras(b);
|
||||
context.startActivity(intent);
|
||||
});
|
||||
holder.peertube_video_image.setOnClickListener(v -> {
|
||||
holder.binding.peertubeVideoImage.setOnClickListener(v -> {
|
||||
Intent intent = new Intent(context, PeertubeActivity.class);
|
||||
Bundle b = new Bundle();
|
||||
b.putString("video_id", video.getId());
|
||||
@ -385,29 +396,74 @@ public class PeertubeAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolde
|
||||
Map<String, List<PlaylistExist>> getPlaylist();
|
||||
}
|
||||
|
||||
@SuppressLint("CheckResult")
|
||||
private void loadImage(ImageView target, String instance, String urlPreview, String thumbnail, boolean blur) {
|
||||
if (urlPreview == null || urlPreview.startsWith("null")) {
|
||||
urlPreview = thumbnail;
|
||||
}
|
||||
if (instance != null) {
|
||||
urlPreview = "https://" + instance + urlPreview;
|
||||
thumbnail = "https://" + instance + thumbnail;
|
||||
} else {
|
||||
urlPreview = "https://" + Helper.getLiveInstance(context) + urlPreview;
|
||||
thumbnail = "https://" + Helper.getLiveInstance(context) + thumbnail;
|
||||
}
|
||||
RequestBuilder<Drawable> requestBuilder = Glide.with(context)
|
||||
.asDrawable();
|
||||
if (blur) {
|
||||
requestBuilder.apply(new RequestOptions().transform(new BlurTransformation(50, 3), new CenterCrop(), new RoundedCorners(10)));
|
||||
} else {
|
||||
requestBuilder.apply(new RequestOptions().transform(new CenterCrop(), new RoundedCorners(10)));
|
||||
}
|
||||
final Drawable[] initialResource = new Drawable[1];
|
||||
String finalUrlPreview = urlPreview;
|
||||
requestBuilder.load(thumbnail).into(
|
||||
new CustomTarget<Drawable>() {
|
||||
@Override
|
||||
public void onResourceReady(@NonNull final Drawable resource, Transition<? super Drawable> transition) {
|
||||
target.setImageDrawable(resource);
|
||||
initialResource[0] = resource;
|
||||
RequestBuilder<Drawable> requestBuilder = Glide.with(context)
|
||||
.asDrawable();
|
||||
if (blur) {
|
||||
requestBuilder.apply(new RequestOptions().transform(new BlurTransformation(50, 3), new CenterCrop(), new RoundedCorners(10)));
|
||||
} else {
|
||||
requestBuilder.apply(new RequestOptions().transform(new CenterCrop(), new RoundedCorners(10)));
|
||||
}
|
||||
requestBuilder.load(finalUrlPreview).into(
|
||||
new CustomTarget<Drawable>() {
|
||||
@Override
|
||||
public void onResourceReady(@NonNull final Drawable resource, Transition<? super Drawable> transition) {
|
||||
target.setImageDrawable(resource);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onLoadCleared(@Nullable Drawable placeholder) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onLoadFailed(@Nullable Drawable errorDrawable) {
|
||||
target.setImageDrawable(initialResource[0]);
|
||||
}
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onLoadCleared(@Nullable Drawable placeholder) {
|
||||
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
}
|
||||
|
||||
static class ViewHolder extends RecyclerView.ViewHolder {
|
||||
LinearLayout main_container, bottom_container;
|
||||
ImageView peertube_profile, peertube_video_image, peertube_video_image_small;
|
||||
TextView peertube_account_name, peertube_views, peertube_duration;
|
||||
TextView peertube_title, peertube_date, header_title, more_actions;
|
||||
ConstraintLayout preview_container;
|
||||
DrawerPeertubeBinding binding;
|
||||
|
||||
public ViewHolder(@NonNull View itemView) {
|
||||
super(itemView);
|
||||
peertube_account_name = itemView.findViewById(R.id.peertube_account_name);
|
||||
peertube_video_image_small = itemView.findViewById(R.id.peertube_video_image_small);
|
||||
peertube_title = itemView.findViewById(R.id.peertube_title);
|
||||
peertube_video_image = itemView.findViewById(R.id.peertube_video_image);
|
||||
peertube_profile = itemView.findViewById(R.id.peertube_profile);
|
||||
peertube_date = itemView.findViewById(R.id.peertube_date);
|
||||
peertube_views = itemView.findViewById(R.id.peertube_views);
|
||||
peertube_duration = itemView.findViewById(R.id.peertube_duration);
|
||||
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);
|
||||
preview_container = itemView.findViewById(R.id.preview_container);
|
||||
ViewHolder(DrawerPeertubeBinding itemView) {
|
||||
super(itemView.getRoot());
|
||||
binding = itemView;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -177,13 +177,14 @@ public class DisplayAccountsFragment extends Fragment implements AccountsListAda
|
||||
accounts.add(block.getBlockedAccount());
|
||||
}
|
||||
}
|
||||
|
||||
if (max_id == null) {
|
||||
max_id = "0";
|
||||
}
|
||||
if (firstLoad && (accounts == null || accounts.size() == 0))
|
||||
textviewNoAction.setVisibility(View.VISIBLE);
|
||||
else
|
||||
textviewNoAction.setVisibility(View.GONE);
|
||||
|
||||
max_id = apiResponse.getMax_id();
|
||||
max_id = String.valueOf(Integer.parseInt(max_id) + 20);
|
||||
if (accounts != null && accounts.size() > 0) {
|
||||
int previousPosition = this.accounts.size();
|
||||
int currentPosition = this.accounts.size();
|
||||
|
@ -14,8 +14,12 @@ package app.fedilab.fedilabtube.fragment;
|
||||
* 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.Manifest;
|
||||
import android.app.Activity;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.content.pm.PackageManager;
|
||||
import android.net.Uri;
|
||||
import android.os.Bundle;
|
||||
import android.os.Handler;
|
||||
import android.os.Looper;
|
||||
@ -25,20 +29,21 @@ import android.view.ViewGroup;
|
||||
import android.view.WindowManager;
|
||||
import android.view.inputmethod.InputMethodManager;
|
||||
import android.widget.Button;
|
||||
import android.widget.EditText;
|
||||
import android.widget.LinearLayout;
|
||||
import android.widget.RelativeLayout;
|
||||
import android.widget.Toast;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.appcompat.app.AlertDialog;
|
||||
import androidx.core.app.ActivityCompat;
|
||||
import androidx.core.content.ContextCompat;
|
||||
import androidx.fragment.app.Fragment;
|
||||
import androidx.lifecycle.ViewModelProvider;
|
||||
import androidx.recyclerview.widget.DividerItemDecoration;
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
import androidx.swiperefreshlayout.widget.SwipeRefreshLayout;
|
||||
|
||||
import com.bumptech.glide.Glide;
|
||||
import com.bumptech.glide.load.resource.bitmap.CenterCrop;
|
||||
import com.bumptech.glide.load.resource.bitmap.RoundedCorners;
|
||||
import com.bumptech.glide.request.RequestOptions;
|
||||
import com.google.android.material.floatingactionbutton.FloatingActionButton;
|
||||
|
||||
import java.util.ArrayList;
|
||||
@ -49,42 +54,47 @@ import app.fedilab.fedilabtube.client.APIResponse;
|
||||
import app.fedilab.fedilabtube.client.RetrofitPeertubeAPI;
|
||||
import app.fedilab.fedilabtube.client.data.ChannelData;
|
||||
import app.fedilab.fedilabtube.client.entities.ChannelParams;
|
||||
import app.fedilab.fedilabtube.databinding.AddChannelBinding;
|
||||
import app.fedilab.fedilabtube.databinding.FragmentRecyclerviewBinding;
|
||||
import app.fedilab.fedilabtube.drawer.ChannelListAdapter;
|
||||
import app.fedilab.fedilabtube.helper.Helper;
|
||||
import app.fedilab.fedilabtube.viewmodel.ChannelsVM;
|
||||
import app.fedilab.fedilabtube.viewmodel.SearchVM;
|
||||
import es.dmoral.toasty.Toasty;
|
||||
|
||||
import static app.fedilab.fedilabtube.PeertubeUploadActivity.MY_PERMISSIONS_REQUEST_READ_EXTERNAL_STORAGE;
|
||||
|
||||
|
||||
public class DisplayChannelsFragment extends Fragment implements ChannelListAdapter.AllChannelRemoved, ChannelListAdapter.EditAlertDialog {
|
||||
|
||||
private Context context;
|
||||
private static final int PICK_AVATAR = 467;
|
||||
private ChannelListAdapter channelListAdapter;
|
||||
private List<ChannelData.Channel> channels;
|
||||
private RelativeLayout mainLoader, nextElementLoader, textviewNoAction;
|
||||
private SwipeRefreshLayout swipeRefreshLayout;
|
||||
private String name;
|
||||
private RecyclerView lv_channels;
|
||||
private View rootView;
|
||||
private FloatingActionButton action_button;
|
||||
private boolean myChannels;
|
||||
private FragmentRecyclerviewBinding binding;
|
||||
private AddChannelBinding bindingDialog;
|
||||
private Uri inputData;
|
||||
private String search_peertube;
|
||||
private String max_id;
|
||||
|
||||
@Override
|
||||
public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
|
||||
|
||||
rootView = inflater.inflate(R.layout.fragment_recyclerview, container, false);
|
||||
|
||||
binding = FragmentRecyclerviewBinding.inflate(LayoutInflater.from(context));
|
||||
rootView = binding.getRoot();
|
||||
context = getContext();
|
||||
Bundle bundle = this.getArguments();
|
||||
channels = new ArrayList<>();
|
||||
myChannels = true;
|
||||
max_id = "0";
|
||||
if (bundle != null) {
|
||||
name = bundle.getString("name", null);
|
||||
myChannels = bundle.getBoolean("myChannels", true);
|
||||
search_peertube = bundle.getString("search_peertube", null);
|
||||
}
|
||||
|
||||
|
||||
swipeRefreshLayout = rootView.findViewById(R.id.swipeContainer);
|
||||
|
||||
if (getActivity() != null) {
|
||||
action_button = getActivity().findViewById(R.id.action_button);
|
||||
if (action_button != null) {
|
||||
@ -93,30 +103,52 @@ public class DisplayChannelsFragment extends Fragment implements ChannelListAdap
|
||||
}
|
||||
}
|
||||
|
||||
lv_channels = rootView.findViewById(R.id.lv_elements);
|
||||
lv_channels.addItemDecoration(new DividerItemDecoration(context, DividerItemDecoration.VERTICAL));
|
||||
mainLoader = rootView.findViewById(R.id.loader);
|
||||
nextElementLoader = rootView.findViewById(R.id.loading_next);
|
||||
textviewNoAction = rootView.findViewById(R.id.no_action);
|
||||
mainLoader.setVisibility(View.VISIBLE);
|
||||
nextElementLoader.setVisibility(View.GONE);
|
||||
channelListAdapter = new ChannelListAdapter(this.channels, myChannels);
|
||||
binding.lvElements.addItemDecoration(new DividerItemDecoration(context, DividerItemDecoration.VERTICAL));
|
||||
channelListAdapter = new ChannelListAdapter(this.channels);
|
||||
channelListAdapter.allChannelRemoved = this;
|
||||
channelListAdapter.editAlertDialog = this;
|
||||
lv_channels.setAdapter(channelListAdapter);
|
||||
binding.lvElements.setAdapter(channelListAdapter);
|
||||
|
||||
final LinearLayoutManager mLayoutManager;
|
||||
mLayoutManager = new LinearLayoutManager(context);
|
||||
lv_channels.setLayoutManager(mLayoutManager);
|
||||
binding.lvElements.setLayoutManager(mLayoutManager);
|
||||
|
||||
swipeRefreshLayout.setOnRefreshListener(this::pullToRefresh);
|
||||
binding.swipeContainer.setOnRefreshListener(this::pullToRefresh);
|
||||
|
||||
loadChannels(max_id);
|
||||
return rootView;
|
||||
}
|
||||
|
||||
private void loadChannels(String max_id) {
|
||||
if (search_peertube == null) {
|
||||
ChannelsVM viewModel = new ViewModelProvider(this).get(ChannelsVM.class);
|
||||
if (name != null) {
|
||||
viewModel.get(RetrofitPeertubeAPI.DataType.CHANNELS_FOR_ACCOUNT, name).observe(DisplayChannelsFragment.this.requireActivity(), this::manageViewChannels);
|
||||
} else {
|
||||
viewModel.get(RetrofitPeertubeAPI.DataType.MY_CHANNELS, null).observe(DisplayChannelsFragment.this.requireActivity(), this::manageViewChannels);
|
||||
}
|
||||
return rootView;
|
||||
} else {
|
||||
SearchVM viewModelSearch = new ViewModelProvider(this).get(SearchVM.class);
|
||||
viewModelSearch.getChannels(max_id, search_peertube).observe(this.requireActivity(), this::manageViewChannels);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onActivityResult(int requestCode, int resultCode, Intent data) {
|
||||
super.onActivityResult(requestCode, resultCode, data);
|
||||
if (requestCode == PICK_AVATAR && resultCode == Activity.RESULT_OK) {
|
||||
if (data == null || data.getData() == null) {
|
||||
Toasty.error(context, getString(R.string.toot_select_image_error), Toast.LENGTH_LONG).show();
|
||||
return;
|
||||
}
|
||||
inputData = data.getData();
|
||||
Glide.with(context)
|
||||
.load(inputData)
|
||||
.thumbnail(0.1f)
|
||||
.apply(new RequestOptions().transform(new CenterCrop(), new RoundedCorners(10)))
|
||||
.into(bindingDialog.profilePicture);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -153,101 +185,129 @@ public class DisplayChannelsFragment extends Fragment implements ChannelListAdap
|
||||
}
|
||||
|
||||
public void scrollToTop() {
|
||||
if (lv_channels != null)
|
||||
lv_channels.setAdapter(channelListAdapter);
|
||||
binding.lvElements.setAdapter(channelListAdapter);
|
||||
}
|
||||
|
||||
private void manageViewChannels(APIResponse apiResponse) {
|
||||
mainLoader.setVisibility(View.GONE);
|
||||
nextElementLoader.setVisibility(View.GONE);
|
||||
binding.loader.setVisibility(View.GONE);
|
||||
binding.loadingNext.setVisibility(View.GONE);
|
||||
if (apiResponse.getError() != null) {
|
||||
Toasty.error(context, apiResponse.getError().getError(), Toast.LENGTH_LONG).show();
|
||||
swipeRefreshLayout.setRefreshing(false);
|
||||
binding.swipeContainer.setRefreshing(false);
|
||||
return;
|
||||
}
|
||||
List<ChannelData.Channel> channels = apiResponse.getChannels();
|
||||
if ((channels == null || channels.size() == 0))
|
||||
textviewNoAction.setVisibility(View.VISIBLE);
|
||||
else
|
||||
textviewNoAction.setVisibility(View.GONE);
|
||||
|
||||
if ((channels == null || channels.size() == 0))
|
||||
binding.noAction.setVisibility(View.VISIBLE);
|
||||
else
|
||||
binding.noAction.setVisibility(View.GONE);
|
||||
max_id = String.valueOf(Integer.parseInt(max_id) + 20);
|
||||
if (channels != null && channels.size() > 0) {
|
||||
int currentPosition = this.channels.size();
|
||||
this.channels.addAll(channels);
|
||||
if (currentPosition == 0) {
|
||||
channelListAdapter = new ChannelListAdapter(this.channels, myChannels);
|
||||
channelListAdapter = new ChannelListAdapter(this.channels);
|
||||
channelListAdapter.allChannelRemoved = DisplayChannelsFragment.this;
|
||||
channelListAdapter.editAlertDialog = DisplayChannelsFragment.this;
|
||||
lv_channels.setAdapter(channelListAdapter);
|
||||
binding.lvElements.setAdapter(channelListAdapter);
|
||||
} else {
|
||||
channelListAdapter.notifyItemRangeChanged(currentPosition, channels.size());
|
||||
}
|
||||
}
|
||||
swipeRefreshLayout.setRefreshing(false);
|
||||
binding.swipeContainer.setRefreshing(false);
|
||||
}
|
||||
|
||||
public void pullToRefresh() {
|
||||
channels = new ArrayList<>();
|
||||
|
||||
swipeRefreshLayout.setRefreshing(true);
|
||||
ChannelsVM viewModel = new ViewModelProvider(this).get(ChannelsVM.class);
|
||||
if (name != null) {
|
||||
viewModel.get(RetrofitPeertubeAPI.DataType.CHANNELS_FOR_ACCOUNT, name).observe(DisplayChannelsFragment.this.requireActivity(), this::manageViewChannels);
|
||||
} else {
|
||||
viewModel.get(RetrofitPeertubeAPI.DataType.MY_CHANNELS, null).observe(DisplayChannelsFragment.this.requireActivity(), this::manageViewChannels);
|
||||
}
|
||||
binding.swipeContainer.setRefreshing(true);
|
||||
loadChannels("0");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onAllChannelRemoved() {
|
||||
textviewNoAction.setVisibility(View.VISIBLE);
|
||||
binding.noAction.setVisibility(View.VISIBLE);
|
||||
}
|
||||
|
||||
|
||||
public void manageAlert(ChannelParams oldChannelValues) {
|
||||
|
||||
|
||||
AlertDialog.Builder dialogBuilder = new AlertDialog.Builder(context);
|
||||
LayoutInflater inflater1 = ((Activity) context).getLayoutInflater();
|
||||
View dialogView = inflater1.inflate(R.layout.add_channel, new LinearLayout(context), false);
|
||||
dialogBuilder.setView(dialogView);
|
||||
EditText display_name = dialogView.findViewById(R.id.display_name);
|
||||
EditText name = dialogView.findViewById(R.id.name);
|
||||
EditText description = dialogView.findViewById(R.id.description);
|
||||
bindingDialog = AddChannelBinding.inflate(LayoutInflater.from(context), null, false);
|
||||
dialogBuilder.setView(bindingDialog.getRoot());
|
||||
|
||||
if (oldChannelValues != null) {
|
||||
display_name.setText(oldChannelValues.getDisplayName());
|
||||
name.setText(oldChannelValues.getName());
|
||||
description.setText(oldChannelValues.getDescription());
|
||||
name.setEnabled(false);
|
||||
bindingDialog.displayName.setText(oldChannelValues.getDisplayName());
|
||||
bindingDialog.name.setText(oldChannelValues.getName());
|
||||
bindingDialog.description.setText(oldChannelValues.getDescription());
|
||||
bindingDialog.name.setEnabled(false);
|
||||
}
|
||||
dialogBuilder.setPositiveButton(R.string.validate, null);
|
||||
dialogBuilder.setNegativeButton(R.string.cancel, (dialog, id) -> dialog.dismiss());
|
||||
|
||||
AlertDialog alertDialog = dialogBuilder.create();
|
||||
int position;
|
||||
if (oldChannelValues == null) {
|
||||
position = -1;
|
||||
} else {
|
||||
position = 0;
|
||||
for (ChannelData.Channel channel : channels) {
|
||||
if (channel.getName().compareTo(oldChannelValues.getName()) == 0) {
|
||||
break;
|
||||
}
|
||||
position++;
|
||||
}
|
||||
}
|
||||
|
||||
bindingDialog.selectFile.setOnClickListener(v -> {
|
||||
if (ContextCompat.checkSelfPermission(context, Manifest.permission.READ_EXTERNAL_STORAGE) !=
|
||||
PackageManager.PERMISSION_GRANTED) {
|
||||
ActivityCompat.requestPermissions((Activity) context,
|
||||
new String[]{Manifest.permission.READ_EXTERNAL_STORAGE},
|
||||
MY_PERMISSIONS_REQUEST_READ_EXTERNAL_STORAGE);
|
||||
return;
|
||||
}
|
||||
|
||||
Intent intent = new Intent(Intent.ACTION_GET_CONTENT);
|
||||
intent.addCategory(Intent.CATEGORY_OPENABLE);
|
||||
intent.setType("*/*");
|
||||
String[] mimetypes = {"image/*"};
|
||||
intent.putExtra(Intent.EXTRA_MIME_TYPES, mimetypes);
|
||||
startActivityForResult(intent, PICK_AVATAR);
|
||||
});
|
||||
if (position >= 0) {
|
||||
Helper.loadGiF(context, channels.get(position).getAvatar() != null ? channels.get(position).getAvatar().getPath() : null, bindingDialog.profilePicture);
|
||||
} else {
|
||||
Glide.with(context)
|
||||
.load(R.drawable.missing_peertube)
|
||||
.thumbnail(0.1f)
|
||||
.apply(new RequestOptions().transform(new CenterCrop(), new RoundedCorners(10)))
|
||||
.into(bindingDialog.profilePicture);
|
||||
}
|
||||
int finalPosition = position;
|
||||
alertDialog.setOnShowListener(dialogInterface -> {
|
||||
|
||||
Button button = alertDialog.getButton(AlertDialog.BUTTON_POSITIVE);
|
||||
button.setOnClickListener(view -> {
|
||||
if (display_name.getText() != null && display_name.getText().toString().trim().length() > 0 && name.getText() != null && name.getText().toString().trim().length() > 0) {
|
||||
if (bindingDialog.displayName.getText() != null && bindingDialog.displayName.getText().toString().trim().length() > 0 && bindingDialog.name.getText() != null && bindingDialog.name.getText().toString().trim().length() > 0) {
|
||||
|
||||
ChannelParams channelCreation = new ChannelParams();
|
||||
channelCreation.setDisplayName(display_name.getText().toString().trim());
|
||||
channelCreation.setName(name.getText().toString().trim());
|
||||
if (description.getText() != null && description.getText().toString().trim().length() > 0) {
|
||||
channelCreation.setDescription(description.getText().toString().trim());
|
||||
channelCreation.setDisplayName(bindingDialog.displayName.getText().toString().trim());
|
||||
channelCreation.setName(bindingDialog.name.getText().toString().trim());
|
||||
if (bindingDialog.description.getText() != null && bindingDialog.description.getText().toString().trim().length() > 0) {
|
||||
channelCreation.setDescription(bindingDialog.description.getText().toString().trim());
|
||||
}
|
||||
new Thread(() -> {
|
||||
APIResponse apiResponse;
|
||||
if (oldChannelValues == null) {
|
||||
apiResponse = new RetrofitPeertubeAPI(context).createOrUpdateChannel(ChannelsVM.action.CREATE_CHANNEL, null, channelCreation);
|
||||
apiResponse = new RetrofitPeertubeAPI(context).createOrUpdateChannel(ChannelsVM.action.CREATE_CHANNEL, null, channelCreation, inputData);
|
||||
} else {
|
||||
apiResponse = new RetrofitPeertubeAPI(context).createOrUpdateChannel(ChannelsVM.action.UPDATE_CHANNEL, channelCreation.getName() + "@" + Helper.getLiveInstance(context), channelCreation);
|
||||
apiResponse = new RetrofitPeertubeAPI(context).createOrUpdateChannel(ChannelsVM.action.UPDATE_CHANNEL, channelCreation.getName() + "@" + Helper.getLiveInstance(context), channelCreation, inputData);
|
||||
}
|
||||
Handler mainHandler = new Handler(Looper.getMainLooper());
|
||||
Runnable myRunnable = () -> {
|
||||
|
||||
if (getActivity() == null)
|
||||
return;
|
||||
if (oldChannelValues == null) {
|
||||
ChannelData.Channel channel = new ChannelData.Channel();
|
||||
channel.setId(apiResponse.getActionReturn());
|
||||
@ -257,16 +317,10 @@ public class DisplayChannelsFragment extends Fragment implements ChannelListAdap
|
||||
channels.add(0, channel);
|
||||
channelListAdapter.notifyItemInserted(0);
|
||||
} else {
|
||||
int position = 0;
|
||||
for (ChannelData.Channel channel : channels) {
|
||||
if (channel.getName().compareTo(oldChannelValues.getName()) == 0) {
|
||||
channel.setDescription(channelCreation.getDescription());
|
||||
channel.setDisplayName(channelCreation.getDisplayName());
|
||||
break;
|
||||
}
|
||||
position++;
|
||||
}
|
||||
channelListAdapter.notifyItemChanged(position);
|
||||
channels.get(finalPosition).setName(channelCreation.getName());
|
||||
channels.get(finalPosition).setDisplayName(channelCreation.getDisplayName());
|
||||
channels.get(finalPosition).setDescription(channelCreation.getDescription());
|
||||
channelListAdapter.notifyItemChanged(finalPosition);
|
||||
}
|
||||
if (action_button != null) {
|
||||
action_button.setEnabled(true);
|
||||
@ -292,7 +346,7 @@ public class DisplayChannelsFragment extends Fragment implements ChannelListAdap
|
||||
//Hide keyboard
|
||||
InputMethodManager imm = (InputMethodManager) context.getSystemService(Context.INPUT_METHOD_SERVICE);
|
||||
assert imm != null;
|
||||
imm.hideSoftInputFromWindow(display_name.getWindowToken(), 0);
|
||||
imm.hideSoftInputFromWindow(bindingDialog.displayName.getWindowToken(), 0);
|
||||
});
|
||||
if (alertDialog.getWindow() != null)
|
||||
alertDialog.getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_VISIBLE);
|
||||
|
@ -65,8 +65,8 @@ import app.fedilab.fedilabtube.viewmodel.ChannelsVM;
|
||||
import app.fedilab.fedilabtube.viewmodel.PlaylistsVM;
|
||||
import es.dmoral.toasty.Toasty;
|
||||
|
||||
import static app.fedilab.fedilabtube.MainActivity.peertubeInformation;
|
||||
import static app.fedilab.fedilabtube.client.RetrofitPeertubeAPI.DataType.MY_CHANNELS;
|
||||
import static app.fedilab.fedilabtube.helper.Helper.peertubeInformation;
|
||||
|
||||
|
||||
public class DisplayPlaylistsFragment extends Fragment {
|
||||
|
@ -22,17 +22,15 @@ import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.view.inputmethod.InputMethodManager;
|
||||
import android.widget.RelativeLayout;
|
||||
import android.widget.TextView;
|
||||
import android.widget.Toast;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.fragment.app.Fragment;
|
||||
import androidx.lifecycle.ViewModelProvider;
|
||||
import androidx.recyclerview.widget.GridLayoutManager;
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
import androidx.swiperefreshlayout.widget.SwipeRefreshLayout;
|
||||
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
@ -41,8 +39,10 @@ import java.util.List;
|
||||
|
||||
import app.fedilab.fedilabtube.BuildConfig;
|
||||
import app.fedilab.fedilabtube.R;
|
||||
import app.fedilab.fedilabtube.client.data.ChannelData;
|
||||
import app.fedilab.fedilabtube.client.data.VideoData;
|
||||
import app.fedilab.fedilabtube.client.entities.SepiaSearch;
|
||||
import app.fedilab.fedilabtube.databinding.FragmentVideoBinding;
|
||||
import app.fedilab.fedilabtube.drawer.AccountsHorizontalListAdapter;
|
||||
import app.fedilab.fedilabtube.drawer.PeertubeAdapter;
|
||||
import app.fedilab.fedilabtube.helper.Helper;
|
||||
@ -61,23 +61,24 @@ public class DisplaySepiaSearchFragment extends Fragment implements AccountsHori
|
||||
private Context context;
|
||||
private PeertubeAdapter peertubeAdapater;
|
||||
private List<VideoData.Video> peertubes;
|
||||
private RelativeLayout mainLoader, nextElementLoader, textviewNoAction;
|
||||
private boolean firstLoad;
|
||||
private SwipeRefreshLayout swipeRefreshLayout;
|
||||
private SharedPreferences sharedpreferences;
|
||||
private TextView textviewNoActionText;
|
||||
private View rootView;
|
||||
private RecyclerView lv_status;
|
||||
private SepiaSearchVM viewModelSearch;
|
||||
private SepiaSearch sepiaSearchVideo;
|
||||
private FragmentVideoBinding binding;
|
||||
|
||||
public DisplaySepiaSearchFragment() {
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
|
||||
rootView = inflater.inflate(R.layout.fragment_video, container, false);
|
||||
binding = FragmentVideoBinding.inflate(inflater, container, false);
|
||||
return binding.getRoot();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
|
||||
|
||||
peertubes = new ArrayList<>();
|
||||
context = getContext();
|
||||
@ -85,40 +86,35 @@ public class DisplaySepiaSearchFragment extends Fragment implements AccountsHori
|
||||
if (bundle != null) {
|
||||
sepiaSearchVideo = bundle.getParcelable("sepiaSearchVideo");
|
||||
}
|
||||
lv_status = rootView.findViewById(R.id.lv_status);
|
||||
flag_loading = true;
|
||||
firstLoad = true;
|
||||
|
||||
assert context != null;
|
||||
sharedpreferences = context.getSharedPreferences(Helper.APP_PREFS, Context.MODE_PRIVATE);
|
||||
swipeRefreshLayout = rootView.findViewById(R.id.swipeContainer);
|
||||
|
||||
mainLoader = rootView.findViewById(R.id.loader);
|
||||
nextElementLoader = rootView.findViewById(R.id.loading_next_status);
|
||||
textviewNoAction = rootView.findViewById(R.id.no_action);
|
||||
textviewNoActionText = rootView.findViewById(R.id.no_action_text);
|
||||
mainLoader.setVisibility(View.VISIBLE);
|
||||
nextElementLoader.setVisibility(View.GONE);
|
||||
|
||||
binding.loader.setVisibility(View.VISIBLE);
|
||||
binding.loadingNextVideos.setVisibility(View.GONE);
|
||||
|
||||
peertubeAdapater = new PeertubeAdapter(this.peertubes, SEPIA_SEARCH, true);
|
||||
lv_status.setAdapter(peertubeAdapater);
|
||||
binding.lvVideos.setAdapter(peertubeAdapater);
|
||||
|
||||
|
||||
if (!Helper.isTablet(context)) {
|
||||
mLayoutManager = new LinearLayoutManager(context);
|
||||
lv_status.setLayoutManager(mLayoutManager);
|
||||
binding.lvVideos.setLayoutManager(mLayoutManager);
|
||||
} else {
|
||||
gLayoutManager = new GridLayoutManager(context, 2);
|
||||
int spanCount = (int) Helper.convertDpToPixel(2, context);
|
||||
int spacing = (int) Helper.convertDpToPixel(5, context);
|
||||
lv_status.addItemDecoration(new GridSpacingItemDecoration(spanCount, spacing, true));
|
||||
lv_status.setLayoutManager(gLayoutManager);
|
||||
binding.lvVideos.addItemDecoration(new GridSpacingItemDecoration(spanCount, spacing, true));
|
||||
binding.lvVideos.setLayoutManager(gLayoutManager);
|
||||
}
|
||||
viewModelSearch = new ViewModelProvider(DisplaySepiaSearchFragment.this).get(SepiaSearchVM.class);
|
||||
swipeRefreshLayout.setOnRefreshListener(this::pullToRefresh);
|
||||
binding.swipeContainer.setOnRefreshListener(this::pullToRefresh);
|
||||
|
||||
|
||||
lv_status.addOnScrollListener(new RecyclerView.OnScrollListener() {
|
||||
binding.lvVideos.addOnScrollListener(new RecyclerView.OnScrollListener() {
|
||||
public void onScrolled(@NonNull RecyclerView recyclerView, int dx, int dy) {
|
||||
if (mLayoutManager != null) {
|
||||
int firstVisibleItem = mLayoutManager.findFirstVisibleItemPosition();
|
||||
@ -129,10 +125,10 @@ public class DisplaySepiaSearchFragment extends Fragment implements AccountsHori
|
||||
if (!flag_loading) {
|
||||
flag_loading = true;
|
||||
loadTimeline();
|
||||
nextElementLoader.setVisibility(View.VISIBLE);
|
||||
binding.loadingNextVideos.setVisibility(View.VISIBLE);
|
||||
}
|
||||
} else {
|
||||
nextElementLoader.setVisibility(View.GONE);
|
||||
binding.loadingNextVideos.setVisibility(View.GONE);
|
||||
}
|
||||
}
|
||||
} else if (gLayoutManager != null) {
|
||||
@ -144,27 +140,26 @@ public class DisplaySepiaSearchFragment extends Fragment implements AccountsHori
|
||||
if (!flag_loading) {
|
||||
flag_loading = true;
|
||||
loadTimeline();
|
||||
nextElementLoader.setVisibility(View.VISIBLE);
|
||||
binding.loadingNextVideos.setVisibility(View.VISIBLE);
|
||||
}
|
||||
} else {
|
||||
nextElementLoader.setVisibility(View.GONE);
|
||||
binding.loadingNextVideos.setVisibility(View.GONE);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
loadTimeline();
|
||||
return rootView;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void onPause() {
|
||||
super.onPause();
|
||||
if (swipeRefreshLayout != null) {
|
||||
swipeRefreshLayout.setEnabled(false);
|
||||
swipeRefreshLayout.setRefreshing(false);
|
||||
swipeRefreshLayout.clearAnimation();
|
||||
if (binding.swipeContainer != null) {
|
||||
binding.swipeContainer.setEnabled(false);
|
||||
binding.swipeContainer.setRefreshing(false);
|
||||
binding.swipeContainer.clearAnimation();
|
||||
}
|
||||
if (getActivity() != null) {
|
||||
InputMethodManager imm = (InputMethodManager) getActivity().getSystemService(Context.INPUT_METHOD_SERVICE);
|
||||
@ -201,12 +196,12 @@ public class DisplaySepiaSearchFragment extends Fragment implements AccountsHori
|
||||
|
||||
private void manageVIewVideos(VideoData videoData) {
|
||||
//hide loaders
|
||||
mainLoader.setVisibility(View.GONE);
|
||||
nextElementLoader.setVisibility(View.GONE);
|
||||
binding.loader.setVisibility(View.GONE);
|
||||
binding.loadingNextVideos.setVisibility(View.GONE);
|
||||
//handle other API error
|
||||
if (videoData == null || videoData.data == null) {
|
||||
Toasty.error(context, context.getString(R.string.toast_error), Toast.LENGTH_LONG).show();
|
||||
swipeRefreshLayout.setRefreshing(false);
|
||||
binding.swipeContainer.setRefreshing(false);
|
||||
flag_loading = false;
|
||||
return;
|
||||
}
|
||||
@ -227,16 +222,16 @@ public class DisplaySepiaSearchFragment extends Fragment implements AccountsHori
|
||||
//If no item were inserted previously the adapter is created
|
||||
if (previousPosition == 0) {
|
||||
peertubeAdapater = new PeertubeAdapter(this.peertubes, SEPIA_SEARCH, true);
|
||||
lv_status.setAdapter(peertubeAdapater);
|
||||
binding.lvVideos.setAdapter(peertubeAdapater);
|
||||
} else
|
||||
peertubeAdapater.notifyItemRangeInserted(previousPosition, videoData.data.size());
|
||||
|
||||
//remove handlers
|
||||
swipeRefreshLayout.setRefreshing(false);
|
||||
textviewNoAction.setVisibility(View.GONE);
|
||||
binding.swipeContainer.setRefreshing(false);
|
||||
binding.noAction.setVisibility(View.GONE);
|
||||
if (firstLoad && (videoData.data == null || videoData.data.size() == 0)) {
|
||||
textviewNoActionText.setText(R.string.no_video_to_display);
|
||||
textviewNoAction.setVisibility(View.VISIBLE);
|
||||
binding.noActionText.setText(R.string.no_video_to_display);
|
||||
binding.noAction.setVisibility(View.VISIBLE);
|
||||
}
|
||||
flag_loading = false;
|
||||
firstLoad = false;
|
||||
@ -244,20 +239,19 @@ public class DisplaySepiaSearchFragment extends Fragment implements AccountsHori
|
||||
|
||||
@Override
|
||||
public void onDestroyView() {
|
||||
if (lv_status != null) {
|
||||
if (binding.lvVideos != null) {
|
||||
try {
|
||||
lv_status.setAdapter(null);
|
||||
binding.lvVideos.setAdapter(null);
|
||||
} catch (Exception ignored) {
|
||||
}
|
||||
}
|
||||
super.onDestroyView();
|
||||
rootView = null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onResume() {
|
||||
super.onResume();
|
||||
swipeRefreshLayout.setEnabled(true);
|
||||
binding.swipeContainer.setEnabled(true);
|
||||
}
|
||||
|
||||
|
||||
@ -279,7 +273,7 @@ public class DisplaySepiaSearchFragment extends Fragment implements AccountsHori
|
||||
}
|
||||
|
||||
@Override
|
||||
public void click(String forAccount) {
|
||||
public void click(ChannelData.Channel forChannel) {
|
||||
pullToRefresh();
|
||||
}
|
||||
|
||||
|
@ -23,21 +23,16 @@ import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.view.inputmethod.InputMethodManager;
|
||||
import android.widget.Button;
|
||||
import android.widget.RelativeLayout;
|
||||
import android.widget.TextView;
|
||||
import android.widget.Toast;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
import androidx.constraintlayout.widget.ConstraintLayout;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.fragment.app.Fragment;
|
||||
import androidx.fragment.app.FragmentManager;
|
||||
import androidx.fragment.app.FragmentTransaction;
|
||||
import androidx.lifecycle.ViewModelProvider;
|
||||
import androidx.recyclerview.widget.GridLayoutManager;
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
import androidx.swiperefreshlayout.widget.SwipeRefreshLayout;
|
||||
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
@ -51,10 +46,12 @@ import app.fedilab.fedilabtube.MainActivity;
|
||||
import app.fedilab.fedilabtube.R;
|
||||
import app.fedilab.fedilabtube.client.APIResponse;
|
||||
import app.fedilab.fedilabtube.client.RetrofitPeertubeAPI;
|
||||
import app.fedilab.fedilabtube.client.data.AccountData;
|
||||
import app.fedilab.fedilabtube.client.data.ChannelData;
|
||||
import app.fedilab.fedilabtube.client.data.VideoData;
|
||||
import app.fedilab.fedilabtube.client.data.VideoPlaylistData;
|
||||
import app.fedilab.fedilabtube.client.entities.PlaylistExist;
|
||||
import app.fedilab.fedilabtube.databinding.FragmentVideoBinding;
|
||||
import app.fedilab.fedilabtube.drawer.AccountsHorizontalListAdapter;
|
||||
import app.fedilab.fedilabtube.drawer.PeertubeAdapter;
|
||||
import app.fedilab.fedilabtube.helper.Helper;
|
||||
@ -81,27 +78,23 @@ public class DisplayVideosFragment extends Fragment implements AccountsHorizonta
|
||||
private List<VideoData.Video> peertubes;
|
||||
private List<ChannelData.Channel> channels;
|
||||
private TimelineVM.TimelineType type;
|
||||
private RelativeLayout mainLoader, nextElementLoader, textviewNoAction;
|
||||
private boolean firstLoad;
|
||||
private SwipeRefreshLayout swipeRefreshLayout;
|
||||
private SharedPreferences sharedpreferences;
|
||||
private String search_peertube;
|
||||
private TextView textviewNoActionText;
|
||||
private View rootView;
|
||||
private RecyclerView lv_status;
|
||||
private boolean check_ScrollingUp;
|
||||
private String forAccount;
|
||||
private ConstraintLayout top_account_container;
|
||||
private ChannelData.Channel forChannel;
|
||||
private TimelineVM viewModelFeeds;
|
||||
private SearchVM viewModelSearch;
|
||||
private AccountsVM viewModelAccounts;
|
||||
private String channelId;
|
||||
private ChannelData.Channel channel;
|
||||
private AccountData.Account account;
|
||||
private Map<String, Boolean> relationship;
|
||||
private Map<String, List<PlaylistExist>> playlists;
|
||||
private String playlistId;
|
||||
private String remoteInstance;
|
||||
private boolean sepiaSearch;
|
||||
private String startDate, endDate;
|
||||
private FragmentVideoBinding binding;
|
||||
private String channelId;
|
||||
|
||||
public DisplayVideosFragment() {
|
||||
}
|
||||
@ -109,9 +102,14 @@ public class DisplayVideosFragment extends Fragment implements AccountsHorizonta
|
||||
|
||||
@Override
|
||||
public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
|
||||
rootView = inflater.inflate(R.layout.fragment_video, container, false);
|
||||
binding = FragmentVideoBinding.inflate(inflater, container, false);
|
||||
return binding.getRoot();
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
|
||||
|
||||
peertubes = new ArrayList<>();
|
||||
channels = new ArrayList<>();
|
||||
context = getContext();
|
||||
@ -120,7 +118,8 @@ public class DisplayVideosFragment extends Fragment implements AccountsHorizonta
|
||||
Bundle bundle = this.getArguments();
|
||||
if (bundle != null) {
|
||||
search_peertube = bundle.getString("search_peertube", null);
|
||||
channelId = bundle.getString("channelId", null);
|
||||
channel = bundle.getParcelable("channel");
|
||||
account = bundle.getParcelable("account");
|
||||
remoteInstance = bundle.getString("peertube_instance", null);
|
||||
sepiaSearch = bundle.getBoolean("sepia_search", false);
|
||||
type = (TimelineVM.TimelineType) bundle.get(Helper.TIMELINE_TYPE);
|
||||
@ -128,54 +127,47 @@ public class DisplayVideosFragment extends Fragment implements AccountsHorizonta
|
||||
startDate = bundle.getString("startDate", null);
|
||||
endDate = bundle.getString("endDate", null);
|
||||
}
|
||||
if (channel != null) {
|
||||
channelId = channel.getAcct();
|
||||
} else if (account != null) {
|
||||
channelId = account.getAcct();
|
||||
}
|
||||
max_id = "0";
|
||||
forAccount = type == TimelineVM.TimelineType.ACCOUNT_VIDEOS ? channelId : null;
|
||||
lv_status = rootView.findViewById(R.id.lv_status);
|
||||
RecyclerView lv_accounts = rootView.findViewById(R.id.lv_accounts);
|
||||
Button display_all = rootView.findViewById(R.id.display_all);
|
||||
top_account_container = rootView.findViewById(R.id.top_account_container);
|
||||
//forChannel = type == TimelineVM.TimelineType.ACCOUNT_VIDEOS ? channelId : null;
|
||||
max_id_accounts = null;
|
||||
flag_loading = true;
|
||||
firstLoad = true;
|
||||
check_ScrollingUp = false;
|
||||
|
||||
assert context != null;
|
||||
sharedpreferences = context.getSharedPreferences(Helper.APP_PREFS, Context.MODE_PRIVATE);
|
||||
swipeRefreshLayout = rootView.findViewById(R.id.swipeContainer);
|
||||
|
||||
mainLoader = rootView.findViewById(R.id.loader);
|
||||
nextElementLoader = rootView.findViewById(R.id.loading_next_status);
|
||||
textviewNoAction = rootView.findViewById(R.id.no_action);
|
||||
textviewNoActionText = rootView.findViewById(R.id.no_action_text);
|
||||
mainLoader.setVisibility(View.VISIBLE);
|
||||
nextElementLoader.setVisibility(View.GONE);
|
||||
binding.loader.setVisibility(View.VISIBLE);
|
||||
binding.loadingNextVideos.setVisibility(View.GONE);
|
||||
|
||||
peertubeAdapater = new PeertubeAdapter(this.peertubes, type, sepiaSearch);
|
||||
peertubeAdapater.playlistListener = this;
|
||||
peertubeAdapater.relationShipListener = this;
|
||||
lv_status.setAdapter(peertubeAdapater);
|
||||
binding.lvVideos.setAdapter(peertubeAdapater);
|
||||
|
||||
accountsHorizontalListAdapter = new AccountsHorizontalListAdapter(this.channels, this);
|
||||
LinearLayoutManager layoutManager
|
||||
= new LinearLayoutManager(context, LinearLayoutManager.HORIZONTAL, false);
|
||||
lv_accounts.setLayoutManager(layoutManager);
|
||||
lv_accounts.setAdapter(accountsHorizontalListAdapter);
|
||||
binding.lvAccounts.setLayoutManager(layoutManager);
|
||||
binding.lvAccounts.setAdapter(accountsHorizontalListAdapter);
|
||||
if (!Helper.isTablet(context)) {
|
||||
mLayoutManager = new LinearLayoutManager(context);
|
||||
lv_status.setLayoutManager(mLayoutManager);
|
||||
binding.lvVideos.setLayoutManager(mLayoutManager);
|
||||
} else {
|
||||
gLayoutManager = new GridLayoutManager(context, 2);
|
||||
int spanCount = (int) Helper.convertDpToPixel(2, context);
|
||||
int spacing = (int) Helper.convertDpToPixel(5, context);
|
||||
lv_status.addItemDecoration(new GridSpacingItemDecoration(spanCount, spacing, true));
|
||||
lv_status.setLayoutManager(gLayoutManager);
|
||||
binding.lvVideos.addItemDecoration(new GridSpacingItemDecoration(spanCount, spacing, true));
|
||||
binding.lvVideos.setLayoutManager(gLayoutManager);
|
||||
}
|
||||
viewModelAccounts = new ViewModelProvider(DisplayVideosFragment.this).get(AccountsVM.class);
|
||||
viewModelFeeds = new ViewModelProvider(DisplayVideosFragment.this).get(TimelineVM.class);
|
||||
viewModelSearch = new ViewModelProvider(DisplayVideosFragment.this).get(SearchVM.class);
|
||||
swipeRefreshLayout.setOnRefreshListener(() -> pullToRefresh(true));
|
||||
binding.swipeContainer.setOnRefreshListener(() -> pullToRefresh(true));
|
||||
|
||||
lv_accounts.addOnScrollListener(new RecyclerView.OnScrollListener() {
|
||||
binding.lvAccounts.addOnScrollListener(new RecyclerView.OnScrollListener() {
|
||||
public void onScrolled(@NonNull RecyclerView recyclerView, int dx, int dy) {
|
||||
int firstVisibleItem = layoutManager.findFirstVisibleItemPosition();
|
||||
if (dy > 0) {
|
||||
@ -190,19 +182,19 @@ public class DisplayVideosFragment extends Fragment implements AccountsHorizonta
|
||||
|
||||
|
||||
if (type != VIDEOS_IN_LOCAL_PLAYLIST) {
|
||||
lv_status.addOnScrollListener(new RecyclerView.OnScrollListener() {
|
||||
binding.lvVideos.addOnScrollListener(new RecyclerView.OnScrollListener() {
|
||||
public void onScrolled(@NonNull RecyclerView recyclerView, int dx, int dy) {
|
||||
if (type == TimelineVM.TimelineType.SUBSCRIBTIONS) {
|
||||
if (dy > 0) {
|
||||
if (check_ScrollingUp) {
|
||||
top_account_container.setVisibility(View.GONE);
|
||||
binding.topAccountContainer.setVisibility(View.GONE);
|
||||
final Handler handler = new Handler();
|
||||
handler.postDelayed(() -> check_ScrollingUp = false, 300);
|
||||
|
||||
}
|
||||
} else {
|
||||
if (!check_ScrollingUp) {
|
||||
top_account_container.setVisibility(View.VISIBLE);
|
||||
binding.topAccountContainer.setVisibility(View.VISIBLE);
|
||||
final Handler handler = new Handler();
|
||||
handler.postDelayed(() -> check_ScrollingUp = true, 300);
|
||||
}
|
||||
@ -217,10 +209,10 @@ public class DisplayVideosFragment extends Fragment implements AccountsHorizonta
|
||||
if (!flag_loading) {
|
||||
flag_loading = true;
|
||||
loadTimeline(max_id);
|
||||
nextElementLoader.setVisibility(View.VISIBLE);
|
||||
binding.loadingNextVideos.setVisibility(View.VISIBLE);
|
||||
}
|
||||
} else {
|
||||
nextElementLoader.setVisibility(View.GONE);
|
||||
binding.loadingNextVideos.setVisibility(View.GONE);
|
||||
}
|
||||
}
|
||||
} else if (gLayoutManager != null) {
|
||||
@ -232,10 +224,10 @@ public class DisplayVideosFragment extends Fragment implements AccountsHorizonta
|
||||
if (!flag_loading) {
|
||||
flag_loading = true;
|
||||
loadTimeline(max_id);
|
||||
nextElementLoader.setVisibility(View.VISIBLE);
|
||||
binding.loadingNextVideos.setVisibility(View.VISIBLE);
|
||||
}
|
||||
} else {
|
||||
nextElementLoader.setVisibility(View.GONE);
|
||||
binding.loadingNextVideos.setVisibility(View.GONE);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -247,27 +239,26 @@ public class DisplayVideosFragment extends Fragment implements AccountsHorizonta
|
||||
viewModel.getAccounts(RetrofitPeertubeAPI.DataType.SUBSCRIBER, max_id).observe(DisplayVideosFragment.this.requireActivity(), this::manageViewAccounts);
|
||||
}
|
||||
loadTimeline(max_id);
|
||||
display_all.setOnClickListener(v -> {
|
||||
forAccount = null;
|
||||
binding.displayAll.setOnClickListener(v -> {
|
||||
forChannel = null;
|
||||
pullToRefresh(false);
|
||||
});
|
||||
return rootView;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onResume() {
|
||||
super.onResume();
|
||||
swipeRefreshLayout.setEnabled(true);
|
||||
binding.swipeContainer.setEnabled(true);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void onPause() {
|
||||
super.onPause();
|
||||
if (swipeRefreshLayout != null) {
|
||||
swipeRefreshLayout.setEnabled(false);
|
||||
swipeRefreshLayout.setRefreshing(false);
|
||||
swipeRefreshLayout.clearAnimation();
|
||||
if (binding.swipeContainer != null) {
|
||||
binding.swipeContainer.setEnabled(false);
|
||||
binding.swipeContainer.setRefreshing(false);
|
||||
binding.swipeContainer.clearAnimation();
|
||||
}
|
||||
if (getActivity() != null) {
|
||||
InputMethodManager imm = (InputMethodManager) getActivity().getSystemService(Context.INPUT_METHOD_SERVICE);
|
||||
@ -304,8 +295,8 @@ public class DisplayVideosFragment extends Fragment implements AccountsHorizonta
|
||||
|
||||
private void manageViewAccounts(APIResponse apiResponse) {
|
||||
if (apiResponse != null && apiResponse.getChannels() != null && apiResponse.getChannels().size() > 0) {
|
||||
if (top_account_container.getVisibility() == View.GONE) {
|
||||
top_account_container.setVisibility(View.VISIBLE);
|
||||
if (binding.topAccountContainer.getVisibility() == View.GONE) {
|
||||
binding.topAccountContainer.setVisibility(View.VISIBLE);
|
||||
}
|
||||
int previousPosition = channels.size();
|
||||
channels.addAll(apiResponse.getChannels());
|
||||
@ -313,6 +304,7 @@ public class DisplayVideosFragment extends Fragment implements AccountsHorizonta
|
||||
if (max_id_accounts == null) {
|
||||
max_id_accounts = "0";
|
||||
}
|
||||
final SharedPreferences sharedpreferences = context.getSharedPreferences(Helper.APP_PREFS, Context.MODE_PRIVATE);
|
||||
//max_id_accounts needs to work like an offset
|
||||
int tootPerPage = sharedpreferences.getInt(Helper.SET_VIDEOS_PER_PAGE, Helper.VIDEOS_PER_PAGE);
|
||||
max_id_accounts = String.valueOf(Integer.parseInt(max_id_accounts) + tootPerPage);
|
||||
@ -322,8 +314,8 @@ public class DisplayVideosFragment extends Fragment implements AccountsHorizonta
|
||||
|
||||
private void manageVIewVideos(APIResponse apiResponse) {
|
||||
//hide loaders
|
||||
mainLoader.setVisibility(View.GONE);
|
||||
nextElementLoader.setVisibility(View.GONE);
|
||||
binding.loader.setVisibility(View.GONE);
|
||||
binding.loadingNextVideos.setVisibility(View.GONE);
|
||||
//handle other API error
|
||||
if (this.peertubes == null || apiResponse == null || (apiResponse.getError() != null)) {
|
||||
if (apiResponse == null)
|
||||
@ -331,7 +323,7 @@ public class DisplayVideosFragment extends Fragment implements AccountsHorizonta
|
||||
else {
|
||||
Toasty.error(context, apiResponse.getError().getError(), Toast.LENGTH_LONG).show();
|
||||
}
|
||||
swipeRefreshLayout.setRefreshing(false);
|
||||
binding.swipeContainer.setRefreshing(false);
|
||||
flag_loading = false;
|
||||
return;
|
||||
}
|
||||
@ -339,6 +331,7 @@ public class DisplayVideosFragment extends Fragment implements AccountsHorizonta
|
||||
if (max_id == null)
|
||||
max_id = "0";
|
||||
//max_id needs to work like an offset
|
||||
final SharedPreferences sharedpreferences = context.getSharedPreferences(Helper.APP_PREFS, Context.MODE_PRIVATE);
|
||||
int videoPerPage = sharedpreferences.getInt(Helper.SET_VIDEOS_PER_PAGE, Helper.VIDEOS_PER_PAGE);
|
||||
max_id = String.valueOf(Integer.parseInt(max_id) + videoPerPage);
|
||||
if (apiResponse.getPeertubes() == null && apiResponse.getVideoPlaylist() == null) {
|
||||
@ -366,15 +359,15 @@ public class DisplayVideosFragment extends Fragment implements AccountsHorizonta
|
||||
peertubeAdapater = new PeertubeAdapter(this.peertubes, type, sepiaSearch);
|
||||
peertubeAdapater.playlistListener = DisplayVideosFragment.this;
|
||||
peertubeAdapater.relationShipListener = DisplayVideosFragment.this;
|
||||
lv_status.setAdapter(peertubeAdapater);
|
||||
binding.lvVideos.setAdapter(peertubeAdapater);
|
||||
} else
|
||||
peertubeAdapater.notifyItemRangeInserted(previousPosition, apiResponse.getPeertubes().size());
|
||||
//remove handlers
|
||||
swipeRefreshLayout.setRefreshing(false);
|
||||
textviewNoAction.setVisibility(View.GONE);
|
||||
binding.swipeContainer.setRefreshing(false);
|
||||
binding.noAction.setVisibility(View.GONE);
|
||||
if (firstLoad && (apiResponse.getPeertubes() == null || apiResponse.getPeertubes().size() == 0)) {
|
||||
textviewNoActionText.setText(R.string.no_video_to_display);
|
||||
textviewNoAction.setVisibility(View.VISIBLE);
|
||||
binding.noActionText.setText(R.string.no_video_to_display);
|
||||
binding.noAction.setVisibility(View.VISIBLE);
|
||||
}
|
||||
flag_loading = false;
|
||||
firstLoad = false;
|
||||
@ -439,14 +432,13 @@ public class DisplayVideosFragment extends Fragment implements AccountsHorizonta
|
||||
|
||||
@Override
|
||||
public void onDestroyView() {
|
||||
if (lv_status != null) {
|
||||
if (binding.lvVideos != null) {
|
||||
try {
|
||||
lv_status.setAdapter(null);
|
||||
binding.lvVideos.setAdapter(null);
|
||||
} catch (Exception ignored) {
|
||||
}
|
||||
}
|
||||
super.onDestroyView();
|
||||
rootView = null;
|
||||
}
|
||||
|
||||
|
||||
@ -461,28 +453,18 @@ public class DisplayVideosFragment extends Fragment implements AccountsHorizonta
|
||||
|
||||
public void pullToRefresh(boolean reload) {
|
||||
if (type == TimelineVM.TimelineType.SUBSCRIBTIONS && reload) {
|
||||
Fragment fragment = ((AppCompatActivity) context).getSupportFragmentManager().findFragmentByTag("2");
|
||||
if (fragment != null) {
|
||||
if (context instanceof MainActivity) {
|
||||
FragmentManager fm = ((MainActivity) context).getSupportFragmentManager();
|
||||
fm.beginTransaction().remove(fragment).commit();
|
||||
DisplayVideosFragment subscriptionFragment = new DisplayVideosFragment();
|
||||
Bundle bundle = new Bundle();
|
||||
bundle.putSerializable(Helper.TIMELINE_TYPE, TimelineVM.TimelineType.SUBSCRIBTIONS);
|
||||
subscriptionFragment.setArguments(bundle);
|
||||
((MainActivity) context).setActive(subscriptionFragment);
|
||||
((MainActivity) context).setSubscriptionFragment(subscriptionFragment);
|
||||
fm.beginTransaction().add(R.id.nav_host_fragment, subscriptionFragment, "2").commit();
|
||||
DisplayVideosFragment subscriptionFragment = ((MainActivity) context).getSubscriptionFragment();
|
||||
if (subscriptionFragment != null) {
|
||||
FragmentTransaction ft = ((MainActivity) context).getSupportFragmentManager().beginTransaction();
|
||||
ft.detach(subscriptionFragment).attach(subscriptionFragment).commit();
|
||||
}
|
||||
}
|
||||
|
||||
} else {
|
||||
int size = peertubes.size();
|
||||
peertubes.clear();
|
||||
peertubes = new ArrayList<>();
|
||||
max_id = "0";
|
||||
peertubeAdapater.notifyItemRangeRemoved(0, size);
|
||||
if (forAccount == null) {
|
||||
if (forChannel == null) {
|
||||
for (ChannelData.Channel channel : channels) {
|
||||
channel.setSelected(false);
|
||||
}
|
||||
@ -494,8 +476,8 @@ public class DisplayVideosFragment extends Fragment implements AccountsHorizonta
|
||||
}
|
||||
|
||||
@Override
|
||||
public void click(String forAccount) {
|
||||
this.forAccount = forAccount;
|
||||
public void click(ChannelData.Channel forChannel) {
|
||||
this.forChannel = forChannel;
|
||||
pullToRefresh(false);
|
||||
}
|
||||
|
||||
@ -515,7 +497,7 @@ public class DisplayVideosFragment extends Fragment implements AccountsHorizonta
|
||||
} else if (type == TimelineVM.TimelineType.HISTORY) {
|
||||
viewModelFeeds.getVideoHistory(max_id, startDate, endDate).observe(this.requireActivity(), this::manageVIewVideos);
|
||||
} else {
|
||||
viewModelFeeds.getVideos(type, max_id, forAccount).observe(this.requireActivity(), this::manageVIewVideos);
|
||||
viewModelFeeds.getVideos(type, max_id, forChannel, account).observe(this.requireActivity(), this::manageVIewVideos);
|
||||
}
|
||||
} else {
|
||||
viewModelSearch.getVideos(max_id, search_peertube).observe(this.requireActivity(), this::manageVIewVideos);
|
||||
|
@ -42,7 +42,6 @@ import app.fedilab.fedilabtube.helper.Helper;
|
||||
import app.fedilab.fedilabtube.helper.ThemeHelper;
|
||||
import es.dmoral.toasty.Toasty;
|
||||
|
||||
import static app.fedilab.fedilabtube.MainActivity.peertubeInformation;
|
||||
import static app.fedilab.fedilabtube.MainActivity.userMe;
|
||||
|
||||
/* Copyright 2020 Thomas Schneider
|
||||
@ -393,7 +392,7 @@ public class SettingsFragment extends PreferenceFragmentCompat implements Shared
|
||||
set_video_in_list_choice.setChecked(videosInList);
|
||||
|
||||
//****** Language filter *********
|
||||
LinkedHashMap<String, String> languages = new LinkedHashMap<>(peertubeInformation.getLanguages());
|
||||
LinkedHashMap<String, String> languages = new LinkedHashMap<>(Helper.peertubeInformation.getLanguages());
|
||||
List<CharSequence> entriesLanguages = new ArrayList<>();
|
||||
List<CharSequence> valuesLanguages = new ArrayList<>();
|
||||
Iterator<Map.Entry<String, String>> it = languages.entrySet().iterator();
|
||||
|
@ -14,8 +14,8 @@ package app.fedilab.fedilabtube.helper;
|
||||
* 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.List;
|
||||
|
||||
import java.util.List;
|
||||
import app.fedilab.fedilabtube.client.data.CommentData;
|
||||
|
||||
public class CommentDecorationHelper {
|
||||
@ -24,6 +24,7 @@ public class CommentDecorationHelper {
|
||||
return numberOfIndentation(0, replyToCommentId, comments);
|
||||
}
|
||||
|
||||
|
||||
private static int numberOfIndentation(int currentIdentation, String replyToCommentId, List<CommentData.Comment> comments) {
|
||||
|
||||
String targetedComment = null;
|
||||
@ -37,7 +38,8 @@ public class CommentDecorationHelper {
|
||||
currentIdentation++;
|
||||
return numberOfIndentation(currentIdentation, targetedComment, comments);
|
||||
} else {
|
||||
return Math.min(currentIdentation, 5);
|
||||
return Math.min(currentIdentation, 15);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -1,130 +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.content.Context;
|
||||
import android.content.res.Resources;
|
||||
import android.graphics.Color;
|
||||
import android.view.Gravity;
|
||||
import android.view.View;
|
||||
import android.widget.Button;
|
||||
import android.widget.ImageButton;
|
||||
import android.widget.MediaController;
|
||||
|
||||
import androidx.core.content.res.ResourcesCompat;
|
||||
|
||||
import app.fedilab.fedilabtube.PeertubeActivity;
|
||||
import app.fedilab.fedilabtube.R;
|
||||
import app.fedilab.fedilabtube.client.data.VideoData.Video;
|
||||
|
||||
|
||||
/**
|
||||
* Created by Thomas
|
||||
* FullScreenMediaController. Inspired from the work at http://www.zoftino.com/android-videoview-playing-videos-full-screen
|
||||
*/
|
||||
public class FullScreenMediaController extends MediaController {
|
||||
|
||||
private final Context context;
|
||||
private ImageButton fullScreen;
|
||||
private Button resolution;
|
||||
private Video peertube;
|
||||
private String resolutionVal;
|
||||
|
||||
public FullScreenMediaController(Context context) {
|
||||
super(context);
|
||||
this.context = context;
|
||||
}
|
||||
|
||||
@SuppressWarnings({"unused", "RedundantSuppression"})
|
||||
public FullScreenMediaController(Context context, Video peertube) {
|
||||
super(context);
|
||||
this.peertube = peertube;
|
||||
this.context = context;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setAnchorView(View view) {
|
||||
|
||||
super.setAnchorView(view);
|
||||
|
||||
//image button for full screen to be added to media controller
|
||||
fullScreen = new ImageButton(context);
|
||||
LayoutParams params =
|
||||
new LayoutParams(LayoutParams.WRAP_CONTENT,
|
||||
LayoutParams.WRAP_CONTENT);
|
||||
params.gravity = Gravity.END;
|
||||
params.rightMargin = 80;
|
||||
params.topMargin = 22;
|
||||
addView(fullScreen, params);
|
||||
|
||||
if (resolutionVal == null)
|
||||
resolutionVal = peertube.getFiles().get(0).getResolutions().getLabel() + "p";
|
||||
resolution = new Button(context);
|
||||
resolution.setAllCaps(false);
|
||||
resolution.setBackgroundColor(Color.TRANSPARENT);
|
||||
resolution.setText(resolutionVal);
|
||||
resolution.setPadding(0, 0, 0, 0);
|
||||
LayoutParams paramsButton =
|
||||
new LayoutParams(LayoutParams.WRAP_CONTENT,
|
||||
LayoutParams.WRAP_CONTENT);
|
||||
paramsButton.gravity = Gravity.START;
|
||||
paramsButton.rightMargin = 80;
|
||||
paramsButton.topMargin = 22;
|
||||
resolution.setOnClickListener(v -> ((PeertubeActivity) getContext()).displayResolution());
|
||||
addView(resolution, paramsButton);
|
||||
|
||||
if (((PeertubeActivity) getContext()).getFullscreen() == fullscreen.ON) {
|
||||
Resources resources = getResources();
|
||||
fullScreen.setImageDrawable(ResourcesCompat.getDrawable(resources, R.drawable.ic_baseline_fullscreen_exit_24, null));
|
||||
} else {
|
||||
Resources resources = getResources();
|
||||
fullScreen.setImageDrawable(ResourcesCompat.getDrawable(resources, R.drawable.ic_baseline_fullscreen_24, null));
|
||||
}
|
||||
//add listener to image button to handle full screen and exit full screen events
|
||||
fullScreen.setOnClickListener(v -> {
|
||||
|
||||
if (((PeertubeActivity) getContext()).getFullscreen() == fullscreen.ON) {
|
||||
((PeertubeActivity) getContext()).setFullscreen(fullscreen.OFF);
|
||||
} else {
|
||||
((PeertubeActivity) getContext()).setFullscreen(fullscreen.ON);
|
||||
}
|
||||
((PeertubeActivity) getContext()).change();
|
||||
changeIcon();
|
||||
});
|
||||
}
|
||||
|
||||
@SuppressWarnings({"unused", "RedundantSuppression"})
|
||||
public void setResolutionVal(String resolutionVal) {
|
||||
this.resolutionVal = resolutionVal;
|
||||
if (resolution != null)
|
||||
resolution.setText(String.format("%sp", resolutionVal));
|
||||
}
|
||||
|
||||
public void changeIcon() {
|
||||
//fullscreen indicator from intent
|
||||
if (((PeertubeActivity) getContext()).getFullscreen() == fullscreen.ON) {
|
||||
Resources resources = getResources();
|
||||
fullScreen.setImageDrawable(ResourcesCompat.getDrawable(resources, R.drawable.ic_baseline_fullscreen_exit_24, null));
|
||||
} else {
|
||||
Resources resources = getResources();
|
||||
fullScreen.setImageDrawable(ResourcesCompat.getDrawable(resources, R.drawable.ic_baseline_fullscreen_24, null));
|
||||
}
|
||||
}
|
||||
|
||||
public enum fullscreen {
|
||||
OFF,
|
||||
ON
|
||||
}
|
||||
}
|
@ -53,6 +53,7 @@ import com.bumptech.glide.request.RequestOptions;
|
||||
|
||||
import java.net.InetAddress;
|
||||
import java.text.DateFormat;
|
||||
import java.text.DecimalFormat;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
@ -68,6 +69,7 @@ import app.fedilab.fedilabtube.client.data.AccountData.Account;
|
||||
import app.fedilab.fedilabtube.client.data.ChannelData;
|
||||
import app.fedilab.fedilabtube.client.data.VideoData;
|
||||
import app.fedilab.fedilabtube.client.entities.File;
|
||||
import app.fedilab.fedilabtube.client.entities.PeertubeInformation;
|
||||
import app.fedilab.fedilabtube.sqlite.AccountDAO;
|
||||
import app.fedilab.fedilabtube.sqlite.Sqlite;
|
||||
import app.fedilab.fedilabtube.webview.CustomWebview;
|
||||
@ -79,6 +81,7 @@ import static android.content.Context.DOWNLOAD_SERVICE;
|
||||
|
||||
public class Helper {
|
||||
|
||||
public static PeertubeInformation peertubeInformation;
|
||||
public static final int RELOAD_MYVIDEOS = 10;
|
||||
public static final String SET_VIDEO_MODE = "set_video_mode";
|
||||
public static final String SET_QUALITY_MODE = "set_quality_mode";
|
||||
@ -121,14 +124,12 @@ public class Helper {
|
||||
public static final String PREF_KEY_ID = "userID";
|
||||
public static final String PREF_KEY_NAME = "my_user_name";
|
||||
public static final String PREF_INSTANCE = "instance";
|
||||
public static final String PREF_INSTANCE_SURF = "instance_surf";
|
||||
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 APP_PREFS = "app_prefs";
|
||||
|
||||
public static final int VIDEOS_PER_PAGE = 10;
|
||||
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";
|
||||
//List of available academies
|
||||
@ -734,7 +735,15 @@ public class Helper {
|
||||
if (video_quality == QUALITY_HIGH) {
|
||||
return files.get(0);
|
||||
} else if (video_quality == QUALITY_LOW) {
|
||||
if (files.get(files.size() - 1).getResolutions().getLabel().trim().toLowerCase().compareTo("0p") != 0) {
|
||||
return files.get(files.size() - 1);
|
||||
} else {
|
||||
if (files.size() > 1) {
|
||||
return files.get(files.size() - 2);
|
||||
} else {
|
||||
return files.get(0);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (files.size() < 3) {
|
||||
return files.get(files.size() - 1);
|
||||
@ -785,4 +794,18 @@ public class Helper {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public static String returnRoundedSize(Context context, long size) {
|
||||
if (size == -1) {
|
||||
return context.getString(R.string.unlimited);
|
||||
} else if (size > 1000000000) {
|
||||
float rounded = (float) size / 1000000000;
|
||||
DecimalFormat df = new DecimalFormat("#.#");
|
||||
return String.format(Locale.getDefault(), "%s%s", df.format(rounded), context.getString(R.string.gb));
|
||||
} else {
|
||||
float rounded = (float) size / 1000000;
|
||||
DecimalFormat df = new DecimalFormat("#.#");
|
||||
return String.format(Locale.getDefault(), "%s%s", df.format(rounded), context.getString(R.string.mb));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,67 @@
|
||||
package app.fedilab.fedilabtube.services;
|
||||
/* 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.annotation.SuppressLint;
|
||||
import android.content.Context;
|
||||
import android.content.SharedPreferences;
|
||||
|
||||
import net.gotev.uploadservice.data.UploadInfo;
|
||||
import net.gotev.uploadservice.network.ServerResponse;
|
||||
import net.gotev.uploadservice.observer.request.RequestObserverDelegate;
|
||||
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.json.JSONException;
|
||||
import org.json.JSONObject;
|
||||
|
||||
import app.fedilab.fedilabtube.helper.Helper;
|
||||
|
||||
public class GlobalUploadObserver implements RequestObserverDelegate {
|
||||
|
||||
@Override
|
||||
public void onCompleted(@NotNull Context context, @NotNull UploadInfo uploadInfo) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCompletedWhileNotObserving() {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(@NotNull Context context, @NotNull UploadInfo uploadInfo, @NotNull Throwable throwable) {
|
||||
throwable.printStackTrace();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onProgress(@NotNull Context context, @NotNull UploadInfo uploadInfo) {
|
||||
}
|
||||
|
||||
@SuppressLint("ApplySharedPref")
|
||||
@Override
|
||||
public void onSuccess(@NotNull Context context, @NotNull UploadInfo uploadInfo, @NotNull ServerResponse serverResponse) {
|
||||
try {
|
||||
JSONObject response = new JSONObject(serverResponse.getBodyString());
|
||||
|
||||
if (response.has("video")) {
|
||||
String videoUuid = response.getJSONObject("video").getString("uuid");
|
||||
SharedPreferences sharedpreferences = context.getSharedPreferences(Helper.APP_PREFS, Context.MODE_PRIVATE);
|
||||
SharedPreferences.Editor editor = sharedpreferences.edit();
|
||||
editor.putString(Helper.VIDEO_ID, videoUuid);
|
||||
editor.commit();
|
||||
}
|
||||
} catch (JSONException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
@ -1,77 +0,0 @@
|
||||
package app.fedilab.fedilabtube.services;
|
||||
/* 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.annotation.SuppressLint;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.content.SharedPreferences;
|
||||
|
||||
import androidx.localbroadcastmanager.content.LocalBroadcastManager;
|
||||
|
||||
import net.gotev.uploadservice.ServerResponse;
|
||||
import net.gotev.uploadservice.UploadInfo;
|
||||
import net.gotev.uploadservice.UploadServiceBroadcastReceiver;
|
||||
|
||||
import org.json.JSONException;
|
||||
import org.json.JSONObject;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
import app.fedilab.fedilabtube.helper.Helper;
|
||||
|
||||
|
||||
public class PeertubeUploadReceiver extends UploadServiceBroadcastReceiver {
|
||||
|
||||
|
||||
@Override
|
||||
public void onProgress(Context context, UploadInfo uploadInfo) {
|
||||
// your code here
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(Context context, UploadInfo uploadInfo, ServerResponse serverResponse,
|
||||
Exception exception) {
|
||||
}
|
||||
|
||||
@SuppressLint("ApplySharedPref")
|
||||
@Override
|
||||
public void onCompleted(Context context, UploadInfo uploadInfo, ServerResponse serverResponse) {
|
||||
try {
|
||||
JSONObject response = new JSONObject(serverResponse.getBodyAsString());
|
||||
|
||||
if (!response.has("video")) { //IT's not from Peertube
|
||||
ArrayList<String> file = uploadInfo.getSuccessfullyUploadedFiles();
|
||||
Intent addMedia = new Intent(Helper.INTENT_ADD_UPLOADED_MEDIA);
|
||||
addMedia.putExtra("response", serverResponse.getBodyAsString());
|
||||
addMedia.putStringArrayListExtra("uploadInfo", file);
|
||||
LocalBroadcastManager.getInstance(context).sendBroadcast(addMedia);
|
||||
} else {
|
||||
String videoID = response.getJSONObject("video").get("id").toString();
|
||||
SharedPreferences sharedpreferences = context.getSharedPreferences(Helper.APP_PREFS, Context.MODE_PRIVATE);
|
||||
SharedPreferences.Editor editor = sharedpreferences.edit();
|
||||
editor.putString(Helper.VIDEO_ID, videoID);
|
||||
editor.apply();
|
||||
}
|
||||
} catch (JSONException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCancelled(Context context, UploadInfo uploadInfo) {
|
||||
// your code here
|
||||
}
|
||||
}
|
@ -36,7 +36,7 @@ import app.fedilab.fedilabtube.client.entities.PeertubeInformation;
|
||||
import app.fedilab.fedilabtube.helper.EmojiHelper;
|
||||
import app.fedilab.fedilabtube.helper.NetworkStateReceiver;
|
||||
|
||||
import static app.fedilab.fedilabtube.MainActivity.peertubeInformation;
|
||||
import static app.fedilab.fedilabtube.helper.Helper.peertubeInformation;
|
||||
|
||||
|
||||
public class RetrieveInfoService extends Service implements NetworkStateReceiver.NetworkStateReceiverListener {
|
||||
|
@ -41,9 +41,9 @@ public class CommentVM extends AndroidViewModel {
|
||||
return apiResponseMutableLiveData;
|
||||
}
|
||||
|
||||
public LiveData<APIResponse> getRepliesComment(String videoId, String commentId) {
|
||||
public LiveData<APIResponse> getRepliesComment(String instance, String videoId, String commentId) {
|
||||
apiResponseMutableLiveData = new MutableLiveData<>();
|
||||
getThreadRepliesComments(videoId, commentId);
|
||||
getThreadRepliesComments(instance, videoId, commentId);
|
||||
return apiResponseMutableLiveData;
|
||||
}
|
||||
|
||||
@ -69,12 +69,17 @@ public class CommentVM extends AndroidViewModel {
|
||||
}
|
||||
|
||||
|
||||
private void getThreadRepliesComments(String videoId, String commentId) {
|
||||
private void getThreadRepliesComments(String instance, String videoId, String commentId) {
|
||||
Context _mContext = getApplication().getApplicationContext();
|
||||
new Thread(() -> {
|
||||
try {
|
||||
RetrofitPeertubeAPI api = new RetrofitPeertubeAPI(_mContext);
|
||||
APIResponse apiResponse = api.getComments(action.GET_REPLIES, videoId, commentId, null);
|
||||
RetrofitPeertubeAPI retrofitPeertubeAPI;
|
||||
if (instance == null) {
|
||||
retrofitPeertubeAPI = new RetrofitPeertubeAPI(_mContext);
|
||||
} else {
|
||||
retrofitPeertubeAPI = new RetrofitPeertubeAPI(_mContext, instance, null);
|
||||
}
|
||||
APIResponse apiResponse = retrofitPeertubeAPI.getComments(action.GET_REPLIES, videoId, commentId, null);
|
||||
Handler mainHandler = new Handler(Looper.getMainLooper());
|
||||
Runnable myRunnable = () -> apiResponseMutableLiveData.setValue(apiResponse);
|
||||
mainHandler.post(myRunnable);
|
||||
|
@ -16,6 +16,7 @@ package app.fedilab.fedilabtube.viewmodel;
|
||||
|
||||
import android.app.Application;
|
||||
import android.content.Context;
|
||||
import android.net.Uri;
|
||||
import android.os.Handler;
|
||||
import android.os.Looper;
|
||||
|
||||
@ -24,8 +25,6 @@ import androidx.lifecycle.AndroidViewModel;
|
||||
import androidx.lifecycle.LiveData;
|
||||
import androidx.lifecycle.MutableLiveData;
|
||||
|
||||
import java.io.File;
|
||||
|
||||
import app.fedilab.fedilabtube.client.APIResponse;
|
||||
import app.fedilab.fedilabtube.client.RetrofitPeertubeAPI;
|
||||
import app.fedilab.fedilabtube.client.entities.VideoParams;
|
||||
@ -39,13 +38,13 @@ public class MyVideoVM extends AndroidViewModel {
|
||||
}
|
||||
|
||||
|
||||
public LiveData<APIResponse> updateVideo(String videoId, VideoParams videoParams, File thumbnail, File previewfile) {
|
||||
public LiveData<APIResponse> updateVideo(String videoId, VideoParams videoParams, Uri thumbnail, Uri previewfile) {
|
||||
apiResponseMutableLiveData = new MutableLiveData<>();
|
||||
update(videoId, videoParams, thumbnail, previewfile);
|
||||
return apiResponseMutableLiveData;
|
||||
}
|
||||
|
||||
private void update(String videoId, VideoParams videoParams, File thumbnail, File previewfile) {
|
||||
private void update(String videoId, VideoParams videoParams, Uri thumbnail, Uri previewfile) {
|
||||
Context _mContext = getApplication().getApplicationContext();
|
||||
new Thread(() -> {
|
||||
try {
|
||||
|
@ -43,12 +43,35 @@ public class SearchVM extends AndroidViewModel {
|
||||
return apiResponseMutableLiveData;
|
||||
}
|
||||
|
||||
|
||||
public LiveData<APIResponse> getChannels(String max_id, String query) {
|
||||
apiResponseMutableLiveData = new MutableLiveData<>();
|
||||
loadChannels(max_id, query);
|
||||
return apiResponseMutableLiveData;
|
||||
}
|
||||
|
||||
public LiveData<APIResponse> searchNextVideos(List<String> tags) {
|
||||
apiResponseMutableLiveData = new MutableLiveData<>();
|
||||
loadNextVideos(tags);
|
||||
return apiResponseMutableLiveData;
|
||||
}
|
||||
|
||||
|
||||
private void loadChannels(String max_id, String query) {
|
||||
Context _mContext = getApplication().getApplicationContext();
|
||||
new Thread(() -> {
|
||||
try {
|
||||
RetrofitPeertubeAPI api = new RetrofitPeertubeAPI(_mContext);
|
||||
APIResponse apiResponse = api.searchChannels(query, max_id);
|
||||
Handler mainHandler = new Handler(Looper.getMainLooper());
|
||||
Runnable myRunnable = () -> apiResponseMutableLiveData.setValue(apiResponse);
|
||||
mainHandler.post(myRunnable);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}).start();
|
||||
}
|
||||
|
||||
private void loadVideos(String max_id, String query) {
|
||||
Context _mContext = getApplication().getApplicationContext();
|
||||
new Thread(() -> {
|
||||
|
@ -30,6 +30,8 @@ import java.util.List;
|
||||
|
||||
import app.fedilab.fedilabtube.client.APIResponse;
|
||||
import app.fedilab.fedilabtube.client.RetrofitPeertubeAPI;
|
||||
import app.fedilab.fedilabtube.client.data.AccountData;
|
||||
import app.fedilab.fedilabtube.client.data.ChannelData;
|
||||
import app.fedilab.fedilabtube.client.data.VideoData;
|
||||
import app.fedilab.fedilabtube.helper.Helper;
|
||||
import app.fedilab.fedilabtube.sqlite.ManagePlaylistsDAO;
|
||||
@ -45,9 +47,9 @@ public class TimelineVM extends AndroidViewModel {
|
||||
super(application);
|
||||
}
|
||||
|
||||
public LiveData<APIResponse> getVideos(TimelineType action, String max_id, String forAccount) {
|
||||
public LiveData<APIResponse> getVideos(TimelineType action, String max_id, ChannelData.Channel forChannel, AccountData.Account forAccount) {
|
||||
apiResponseMutableLiveData = new MutableLiveData<>();
|
||||
loadVideos(action, max_id, forAccount);
|
||||
loadVideos(action, max_id, forChannel, forAccount);
|
||||
return apiResponseMutableLiveData;
|
||||
}
|
||||
|
||||
@ -122,6 +124,11 @@ public class TimelineVM extends AndroidViewModel {
|
||||
|
||||
private void getSingle(String instance, String videoId, boolean myVideo) {
|
||||
Context _mContext = getApplication().getApplicationContext();
|
||||
boolean canUseToken = false;
|
||||
if (instance == null || instance.compareTo(Helper.getLiveInstance(_mContext)) == 0) {
|
||||
canUseToken = true;
|
||||
}
|
||||
boolean finalCanUseToken = canUseToken;
|
||||
new Thread(() -> {
|
||||
try {
|
||||
RetrofitPeertubeAPI retrofitPeertubeAPI;
|
||||
@ -130,8 +137,8 @@ public class TimelineVM extends AndroidViewModel {
|
||||
} else {
|
||||
retrofitPeertubeAPI = new RetrofitPeertubeAPI(_mContext, instance, null);
|
||||
}
|
||||
APIResponse apiResponse = retrofitPeertubeAPI.getVideos(videoId, myVideo);
|
||||
if (Helper.isLoggedIn(_mContext) && !myVideo && instance == null) {
|
||||
APIResponse apiResponse = retrofitPeertubeAPI.getVideos(videoId, myVideo, finalCanUseToken);
|
||||
if (Helper.isLoggedIn(_mContext) && instance == null) {
|
||||
if (apiResponse.getPeertubes() != null && apiResponse.getPeertubes().size() > 0 && apiResponse.getPeertubes().get(0) != null) {
|
||||
APIResponse response = new RetrofitPeertubeAPI(_mContext).getRating(videoId);
|
||||
if (response != null)
|
||||
@ -184,15 +191,25 @@ public class TimelineVM extends AndroidViewModel {
|
||||
}).start();
|
||||
}
|
||||
|
||||
private void loadVideos(TimelineType timeline, String max_id, String forAccount) {
|
||||
private void loadVideos(TimelineType timeline, String max_id, ChannelData.Channel forChannel, AccountData.Account forAccount) {
|
||||
Context _mContext = getApplication().getApplicationContext();
|
||||
new Thread(() -> {
|
||||
try {
|
||||
RetrofitPeertubeAPI retrofitPeertubeAPI = new RetrofitPeertubeAPI(_mContext);
|
||||
RetrofitPeertubeAPI retrofitPeertubeAPI;
|
||||
String acct = null;
|
||||
if (forChannel != null) {
|
||||
retrofitPeertubeAPI = new RetrofitPeertubeAPI(_mContext, forChannel.getHost(), null);
|
||||
acct = forChannel.getAcct();
|
||||
} else if (forAccount != null) {
|
||||
retrofitPeertubeAPI = new RetrofitPeertubeAPI(_mContext, forAccount.getHost(), null);
|
||||
acct = forAccount.getAcct();
|
||||
} else {
|
||||
retrofitPeertubeAPI = new RetrofitPeertubeAPI(_mContext);
|
||||
}
|
||||
if (timeline == null)
|
||||
return;
|
||||
APIResponse apiResponse;
|
||||
apiResponse = retrofitPeertubeAPI.getTL(timeline, max_id, forAccount);
|
||||
apiResponse = retrofitPeertubeAPI.getTL(timeline, max_id, acct);
|
||||
Handler mainHandler = new Handler(Looper.getMainLooper());
|
||||
Runnable myRunnable = () -> apiResponseMutableLiveData.setValue(apiResponse);
|
||||
mainHandler.post(myRunnable);
|
||||
|
10
app/src/main/res/drawable/ic_baseline_cancel_24.xml
Normal file
10
app/src/main/res/drawable/ic_baseline_cancel_24.xml
Normal file
@ -0,0 +1,10 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:tint="?attr/colorControlNormal"
|
||||
android:viewportWidth="24"
|
||||
android:viewportHeight="24">
|
||||
<path
|
||||
android:fillColor="@android:color/white"
|
||||
android:pathData="M12,2C6.47,2 2,6.47 2,12s4.47,10 10,10 10,-4.47 10,-10S17.53,2 12,2zM17,15.59L15.59,17 12,13.41 8.41,17 7,15.59 10.59,12 7,8.41 8.41,7 12,10.59 15.59,7 17,8.41 13.41,12 17,15.59z" />
|
||||
</vector>
|
@ -1,8 +1,8 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:tint="?attr/colorControlNormal"
|
||||
android:viewportWidth="24"
|
||||
android:tint="?attr/colorControlNormal"
|
||||
android:viewportHeight="24">
|
||||
<path
|
||||
android:fillColor="@android:color/white"
|
||||
|
10
app/src/main/res/drawable/ic_baseline_error_24.xml
Normal file
10
app/src/main/res/drawable/ic_baseline_error_24.xml
Normal file
@ -0,0 +1,10 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:tint="?attr/colorControlNormal"
|
||||
android:viewportWidth="24"
|
||||
android:viewportHeight="24">
|
||||
<path
|
||||
android:fillColor="@android:color/white"
|
||||
android:pathData="M12,2C6.48,2 2,6.48 2,12s4.48,10 10,10 10,-4.48 10,-10S17.52,2 12,2zM13,17h-2v-2h2v2zM13,13h-2L11,7h2v6z" />
|
||||
</vector>
|
10
app/src/main/res/drawable/ic_baseline_speed_24.xml
Normal file
10
app/src/main/res/drawable/ic_baseline_speed_24.xml
Normal file
@ -0,0 +1,10 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:tint="?attr/colorControlNormal"
|
||||
android:viewportWidth="24"
|
||||
android:viewportHeight="24">
|
||||
<path
|
||||
android:fillColor="@android:color/white"
|
||||
android:pathData="M20.38,8.57l-1.23,1.85a8,8 0,0 1,-0.22 7.58L5.07,18A8,8 0,0 1,15.58 6.85l1.85,-1.23A10,10 0,0 0,3.35 19a2,2 0,0 0,1.72 1h13.85a2,2 0,0 0,1.74 -1,10 10,0 0,0 -0.27,-10.44zM10.59,15.41a2,2 0,0 0,2.83 0l5.66,-8.49 -8.49,5.66a2,2 0,0 0,0 2.83z" />
|
||||
</vector>
|
10
app/src/main/res/drawable/ic_sensitive_content.xml
Normal file
10
app/src/main/res/drawable/ic_sensitive_content.xml
Normal file
@ -0,0 +1,10 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:tint="@color/red_1"
|
||||
android:viewportWidth="24"
|
||||
android:viewportHeight="24">
|
||||
<path
|
||||
android:fillColor="@android:color/white"
|
||||
android:pathData="M12,7c2.76,0 5,2.24 5,5 0,0.65 -0.13,1.26 -0.36,1.83l2.92,2.92c1.51,-1.26 2.7,-2.89 3.43,-4.75 -1.73,-4.39 -6,-7.5 -11,-7.5 -1.4,0 -2.74,0.25 -3.98,0.7l2.16,2.16C10.74,7.13 11.35,7 12,7zM2,4.27l2.28,2.28 0.46,0.46C3.08,8.3 1.78,10.02 1,12c1.73,4.39 6,7.5 11,7.5 1.55,0 3.03,-0.3 4.38,-0.84l0.42,0.42L19.73,22 21,20.73 3.27,3 2,4.27zM7.53,9.8l1.55,1.55c-0.05,0.21 -0.08,0.43 -0.08,0.65 0,1.66 1.34,3 3,3 0.22,0 0.44,-0.03 0.65,-0.08l1.55,1.55c-0.67,0.33 -1.41,0.53 -2.2,0.53 -2.76,0 -5,-2.24 -5,-5 0,-0.79 0.2,-1.53 0.53,-2.2zM11.84,9.02l3.15,3.15 0.02,-0.16c0,-1.66 -1.34,-3 -3,-3l-0.17,0.01z" />
|
||||
</vector>
|
24
app/src/main/res/drawable/progress_bar.xml
Normal file
24
app/src/main/res/drawable/progress_bar.xml
Normal file
@ -0,0 +1,24 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item android:id="@android:id/background">
|
||||
<shape>
|
||||
<corners android:radius="8dp" />
|
||||
<solid android:color="@color/gray_light" />
|
||||
</shape>
|
||||
</item>
|
||||
|
||||
<item
|
||||
android:id="@android:id/progress"
|
||||
android:bottom="1dp"
|
||||
android:left="1dp"
|
||||
android:right="1dp"
|
||||
android:top="1dp">
|
||||
|
||||
<scale android:scaleWidth="100%">
|
||||
<shape>
|
||||
<corners android:radius="8dp" />
|
||||
<solid android:color="@color/colorAccent" />
|
||||
</shape>
|
||||
</scale>
|
||||
</item>
|
||||
</layer-list>
|
38
app/src/main/res/drawable/rounded_decoration_bottom.xml
Normal file
38
app/src/main/res/drawable/rounded_decoration_bottom.xml
Normal file
@ -0,0 +1,38 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
|
||||
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item>
|
||||
<rotate
|
||||
android:fromDegrees="180"
|
||||
android:pivotX="50%"
|
||||
android:pivotY="50%"
|
||||
android:toDegrees="270">
|
||||
<shape android:shape="rectangle">
|
||||
<size
|
||||
android:width="30dp"
|
||||
android:height="30dp" />
|
||||
<solid android:color="@color/colorAccent" />
|
||||
<corners android:bottomLeftRadius="30dp" />
|
||||
</shape>
|
||||
</rotate>
|
||||
|
||||
</item>
|
||||
<item
|
||||
android:right="1.5dp"
|
||||
android:top="1.5dp">
|
||||
<rotate
|
||||
android:fromDegrees="180"
|
||||
android:pivotX="50%"
|
||||
android:pivotY="50%"
|
||||
android:toDegrees="270">
|
||||
<shape android:shape="rectangle">
|
||||
<size
|
||||
android:width="30dp"
|
||||
android:height="30dp" />
|
||||
<solid android:color="?attr/backgroundView" />
|
||||
<corners android:bottomLeftRadius="30dp" />
|
||||
</shape>
|
||||
</rotate>
|
||||
</item>
|
||||
|
||||
</layer-list>
|
24
app/src/main/res/drawable/rounded_decoration_top.xml
Normal file
24
app/src/main/res/drawable/rounded_decoration_top.xml
Normal file
@ -0,0 +1,24 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
|
||||
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item>
|
||||
<shape android:shape="rectangle">
|
||||
<size
|
||||
android:width="30dp"
|
||||
android:height="30dp" />
|
||||
<solid android:color="@color/colorAccent" />
|
||||
<corners android:bottomLeftRadius="30dp" />
|
||||
</shape>
|
||||
</item>
|
||||
<item
|
||||
android:bottom="1.5dp"
|
||||
android:left="1.5dp">
|
||||
<shape android:shape="rectangle">
|
||||
<size
|
||||
android:width="30dp"
|
||||
android:height="30dp" />
|
||||
<solid android:color="?attr/backgroundView" />
|
||||
<corners android:bottomLeftRadius="30dp" />
|
||||
</shape>
|
||||
</item>
|
||||
</layer-list>
|
@ -63,13 +63,12 @@
|
||||
</com.google.android.material.appbar.AppBarLayout>
|
||||
|
||||
|
||||
<FrameLayout
|
||||
<androidx.viewpager.widget.ViewPager
|
||||
app:layout_behavior="@string/appbar_scrolling_view_behavior"
|
||||
android:id="@+id/nav_host_fragment"
|
||||
android:id="@+id/viewpager"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginBottom="?attr/actionBarSize"
|
||||
/>
|
||||
android:layout_marginBottom="?attr/actionBarSize" />
|
||||
<com.google.android.material.bottomnavigation.BottomNavigationView
|
||||
android:id="@+id/nav_view"
|
||||
android:layout_gravity="bottom"
|
||||
|
@ -25,6 +25,10 @@
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
android:orientation="vertical">
|
||||
|
||||
<RelativeLayout
|
||||
@ -40,6 +44,7 @@
|
||||
android:layout_centerInParent="true"
|
||||
android:layout_gravity="center"
|
||||
android:background="#000000"
|
||||
android:animateLayoutChanges="true"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
@ -47,6 +52,7 @@
|
||||
|
||||
<com.github.vkay94.dtpv.DoubleTapPlayerView
|
||||
android:id="@+id/doubleTapPlayerView"
|
||||
android:animateLayoutChanges="true"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
app:use_controller="true"
|
||||
@ -104,17 +110,45 @@
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="20dp"
|
||||
android:layout_marginLeft="20dp"
|
||||
android:layout_marginEnd="20dp"
|
||||
android:layout_marginRight="20dp"
|
||||
android:orientation="vertical">
|
||||
|
||||
<androidx.cardview.widget.CardView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
android:padding="10dp">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal"
|
||||
tools:ignore="UseCompoundDrawables">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/peertube_title"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="5dp" />
|
||||
android:layout_marginTop="5dp"
|
||||
android:layout_weight="1" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/video_sensitive"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:layout_marginStart="10dp"
|
||||
android:layout_marginLeft="10dp"
|
||||
android:layout_marginEnd="10dp"
|
||||
android:layout_marginRight="10dp"
|
||||
android:contentDescription="@string/sensitive_content"
|
||||
android:gravity="center_horizontal"
|
||||
android:src="@drawable/ic_sensitive_content"
|
||||
android:visibility="invisible" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
@ -123,15 +157,15 @@
|
||||
android:orientation="horizontal">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/pp_channel"
|
||||
android:layout_width="50dp"
|
||||
android:layout_height="50dp"
|
||||
android:id="@+id/pp_channel"
|
||||
android:layout_marginStart="10dp"
|
||||
android:layout_marginLeft="10dp"
|
||||
android:layout_marginEnd="10dp"
|
||||
android:layout_marginRight="10dp"
|
||||
android:contentDescription="@string/profile_picture"
|
||||
/>
|
||||
android:contentDescription="@string/profile_picture" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/peertube_view_count"
|
||||
android:layout_width="wrap_content"
|
||||
@ -177,21 +211,8 @@
|
||||
app:drawableTopCompat="@drawable/ic_baseline_thumb_down_alt_24"
|
||||
tools:ignore="HardcodedText" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/peertube_bookmark"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:layout_marginStart="10dp"
|
||||
android:layout_marginLeft="10dp"
|
||||
android:layout_marginEnd="10dp"
|
||||
android:layout_marginRight="10dp"
|
||||
android:drawablePadding="5dp"
|
||||
android:gravity="center_horizontal"
|
||||
android:text=""
|
||||
app:drawableTopCompat="@drawable/ic_baseline_bookmark_border_24" />
|
||||
|
||||
<TextView
|
||||
<ImageView
|
||||
android:id="@+id/peertube_playlist"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
@ -202,9 +223,23 @@
|
||||
android:layout_marginRight="10dp"
|
||||
android:drawablePadding="5dp"
|
||||
android:gravity="center_horizontal"
|
||||
android:text=""
|
||||
android:contentDescription="@string/playlists"
|
||||
android:visibility="gone"
|
||||
app:drawableTopCompat="@drawable/ic_baseline_list_24" />
|
||||
android:src="@drawable/ic_baseline_list_24" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/video_information"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:layout_marginStart="10dp"
|
||||
android:layout_marginLeft="10dp"
|
||||
android:layout_marginEnd="10dp"
|
||||
android:layout_marginRight="10dp"
|
||||
android:gravity="center_horizontal"
|
||||
android:contentDescription="@string/information"
|
||||
android:src="@drawable/ic_baseline_info_24" />
|
||||
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
@ -231,19 +266,22 @@
|
||||
|
||||
<TextView
|
||||
android:id="@+id/peertube_description"
|
||||
android:textIsSelectable="true"
|
||||
android:autoLink="web"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="10dp" />
|
||||
android:layout_marginTop="10dp"
|
||||
android:autoLink="web"
|
||||
android:textIsSelectable="true" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/peertube_description_more"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="2dp"
|
||||
android:text="@string/show_more"
|
||||
android:visibility="gone"
|
||||
android:textColor="?attr/colorAccent"
|
||||
android:layout_marginTop="2dp" />
|
||||
android:visibility="gone" />
|
||||
</LinearLayout>
|
||||
</androidx.cardview.widget.CardView>
|
||||
|
||||
<Button
|
||||
android:layout_gravity="center"
|
||||
@ -253,6 +291,7 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/add_public_comment"/>
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:layout_marginStart="10dp"
|
||||
android:id="@+id/peertube_comments"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content" />
|
||||
@ -287,17 +326,12 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
<LinearLayout
|
||||
android:layout_marginStart="20dp"
|
||||
android:layout_marginLeft="20dp"
|
||||
android:layout_marginEnd="20dp"
|
||||
android:layout_marginRight="20dp"
|
||||
android:id="@+id/main_container"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:divider="?android:dividerHorizontal"
|
||||
android:orientation="vertical"
|
||||
android:showDividers="end">
|
||||
|
||||
<ImageView
|
||||
android:layout_gravity="end|center_vertical"
|
||||
android:id="@+id/close_reply"
|
||||
@ -315,41 +349,74 @@
|
||||
</LinearLayout>
|
||||
|
||||
</androidx.core.widget.NestedScrollView>
|
||||
<androidx.core.widget.NestedScrollView
|
||||
android:background="?android:colorBackground"
|
||||
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
<!-- View where the video will be shown when video goes fullscreen -->
|
||||
<RelativeLayout
|
||||
android:id="@+id/videoLayout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@android:color/black"
|
||||
android:visibility="gone" />
|
||||
</LinearLayout>
|
||||
|
||||
<RelativeLayout
|
||||
android:id="@+id/video_params"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="?attr/backgroundView"
|
||||
android:minHeight="100dp"
|
||||
android:translationZ="2dp"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent">
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/main_options_video"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:layout_margin="30dp" />
|
||||
</RelativeLayout>
|
||||
|
||||
<androidx.core.widget.NestedScrollView
|
||||
android:id="@+id/post_comment"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
android:layout_height="match_parent"
|
||||
android:background="?android:colorBackground"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_marginStart="20dp"
|
||||
android:layout_marginLeft="20dp"
|
||||
android:layout_marginEnd="20dp"
|
||||
android:layout_marginRight="20dp"
|
||||
android:id="@+id/post_main_container"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="10dp"
|
||||
android:divider="?android:dividerHorizontal"
|
||||
android:orientation="vertical"
|
||||
android:showDividers="end">
|
||||
|
||||
<ImageView
|
||||
android:layout_margin="5dp"
|
||||
android:layout_gravity="end|center_vertical"
|
||||
android:id="@+id/close_post"
|
||||
android:layout_width="24dp"
|
||||
android:layout_height="24dp"
|
||||
android:layout_gravity="end|center_vertical"
|
||||
android:layout_margin="5dp"
|
||||
android:contentDescription="@string/close"
|
||||
android:src="@drawable/ic_baseline_close_24" />
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/reply_content"
|
||||
android:visibility="gone"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
android:layout_height="wrap_content"
|
||||
android:visibility="gone">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/comment_account_profile"
|
||||
android:layout_width="40dp"
|
||||
@ -374,8 +441,8 @@
|
||||
android:id="@+id/comment_account_username"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="2dp"
|
||||
android:layout_marginStart="5dp"
|
||||
android:layout_marginTop="2dp"
|
||||
android:ellipsize="end"
|
||||
android:singleLine="true"
|
||||
android:textSize="12sp"
|
||||
@ -405,86 +472,114 @@
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/comment_account_profile" />
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/write_comment_container"
|
||||
android:layout_margin="10dp"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="10dp">
|
||||
|
||||
<View
|
||||
android:id="@+id/separator_top"
|
||||
android:layout_margin="5dp"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintBottom_toTopOf="@+id/write_container"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1px"
|
||||
android:background="@android:color/darker_gray"/>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
app:layout_constraintTop_toBottomOf="@+id/separator_top"
|
||||
android:layout_margin="5dp"
|
||||
android:background="@android:color/darker_gray"
|
||||
app:layout_constraintBottom_toTopOf="@+id/write_container"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintBottom_toTopOf="@+id/separator_bottom"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/write_container"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintBottom_toTopOf="@+id/separator_bottom"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/separator_top">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/my_pp"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
android:layout_width="30dp"
|
||||
android:layout_height="30dp"
|
||||
android:contentDescription="@string/profile_picture" />
|
||||
android:contentDescription="@string/profile_picture"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<com.google.android.material.textfield.TextInputLayout
|
||||
android:id="@+id/text_field_boxes"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toEndOf="@+id/my_pp"
|
||||
app:layout_constraintEnd_toEndOf="parent">
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
|
||||
<com.google.android.material.textfield.TextInputEditText
|
||||
android:id="@+id/add_comment_write"
|
||||
android:gravity="top"
|
||||
android:inputType="textMultiLine"
|
||||
android:hint="@string/add_public_reply"
|
||||
android:minLines="4"
|
||||
android:maxLines="8"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent" />
|
||||
android:layout_height="match_parent"
|
||||
android:gravity="top"
|
||||
android:hint="@string/add_public_reply"
|
||||
android:inputType="textMultiLine"
|
||||
android:maxLines="8"
|
||||
android:minLines="4" />
|
||||
</com.google.android.material.textfield.TextInputLayout>
|
||||
|
||||
<Button
|
||||
app:layout_constraintTop_toBottomOf="@+id/text_field_boxes"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
style="@style/Widget.AppCompat.Button.Borderless.Colored"
|
||||
android:id="@+id/send"
|
||||
style="@style/Widget.AppCompat.Button.Borderless.Colored"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/send_comment"/>
|
||||
android:text="@string/send_comment"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/text_field_boxes" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
<View
|
||||
android:id="@+id/separator_bottom"
|
||||
android:layout_margin="5dp"
|
||||
app:layout_constraintTop_toBottomOf="@+id/write_container"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1px"
|
||||
android:background="@android:color/darker_gray"/>
|
||||
android:layout_margin="5dp"
|
||||
android:background="@android:color/darker_gray"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/write_container" />
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
</LinearLayout>
|
||||
|
||||
</androidx.core.widget.NestedScrollView>
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
<!-- View where the video will be shown when video goes fullscreen -->
|
||||
<RelativeLayout
|
||||
android:id="@+id/videoLayout"
|
||||
<androidx.core.widget.NestedScrollView
|
||||
android:id="@+id/video_params_submenu"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@android:color/black"
|
||||
android:visibility="gone" />
|
||||
</LinearLayout>
|
||||
android:layout_height="wrap_content"
|
||||
android:background="?attr/backgroundView"
|
||||
android:minHeight="300dp"
|
||||
android:translationZ="3dp"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent">
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/subMenuTitle"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="@dimen/fab_margin"
|
||||
android:textSize="16sp" />
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/subMenuRecycler"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:layout_margin="30dp" />
|
||||
</RelativeLayout>
|
||||
|
||||
</androidx.core.widget.NestedScrollView>
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
@ -26,24 +26,21 @@
|
||||
android:orientation="vertical">
|
||||
|
||||
<!-- Video title -->
|
||||
<LinearLayout
|
||||
<com.google.android.material.textfield.TextInputLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical">
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:labelFor="@+id/p_video_title"
|
||||
android:text="@string/title" />
|
||||
|
||||
<EditText
|
||||
<com.google.android.material.textfield.TextInputEditText
|
||||
android:id="@+id/p_video_title"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:hint="@string/title"
|
||||
android:importantForAutofill="no"
|
||||
android:inputType="text" />
|
||||
</LinearLayout>
|
||||
android:inputType="text"
|
||||
android:paddingTop="2dp"
|
||||
android:singleLine="true" />
|
||||
</com.google.android.material.textfield.TextInputLayout>
|
||||
|
||||
|
||||
<!-- Video media -->
|
||||
<LinearLayout
|
||||
@ -103,26 +100,24 @@
|
||||
|
||||
|
||||
<!-- video description -->
|
||||
<LinearLayout
|
||||
<!-- Video title -->
|
||||
<com.google.android.material.textfield.TextInputLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical">
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:labelFor="@+id/p_video_description"
|
||||
android:text="@string/description" />
|
||||
|
||||
<EditText
|
||||
<com.google.android.material.textfield.TextInputEditText
|
||||
android:id="@+id/p_video_description"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:hint="@string/description"
|
||||
android:importantForAutofill="no"
|
||||
android:inputType="textMultiLine"
|
||||
android:paddingTop="2dp"
|
||||
android:gravity="top"
|
||||
android:lines="5"
|
||||
android:maxLines="5"
|
||||
android:scrollbars="vertical" />
|
||||
</LinearLayout>
|
||||
android:singleLine="false" />
|
||||
</com.google.android.material.textfield.TextInputLayout>
|
||||
|
||||
<!-- Videos channels -->
|
||||
<LinearLayout
|
||||
|
@ -14,7 +14,7 @@
|
||||
You should have received a copy of the GNU General Public License along with TubeLab; if not,
|
||||
see <http://www.gnu.org/licenses>.
|
||||
-->
|
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
<androidx.core.widget.NestedScrollView xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
@ -26,7 +26,70 @@
|
||||
android:layout_marginTop="50dp"
|
||||
android:orientation="vertical">
|
||||
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="10dp"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:labelFor="@+id/total_quota"
|
||||
android:text="@string/total_video_quota" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/total_quota_value"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="20dp" />
|
||||
</LinearLayout>
|
||||
|
||||
<ProgressBar
|
||||
android:id="@+id/total_quota"
|
||||
style="@style/Widget.AppCompat.ProgressBar.Horizontal"
|
||||
android:layout_width="300dp"
|
||||
android:layout_height="20dp"
|
||||
android:layout_gravity="center"
|
||||
android:layout_marginTop="10dp"
|
||||
android:indeterminate="false"
|
||||
android:max="100"
|
||||
android:progressDrawable="@drawable/progress_bar" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="10dp"
|
||||
android:layout_marginTop="20dp"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:labelFor="@+id/daily_quota"
|
||||
android:text="@string/daily_video_quota" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/daily_quota_value"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="20dp" />
|
||||
</LinearLayout>
|
||||
|
||||
<ProgressBar
|
||||
android:id="@+id/daily_quota"
|
||||
style="@style/Widget.AppCompat.ProgressBar.Horizontal"
|
||||
android:layout_width="300dp"
|
||||
android:layout_height="20dp"
|
||||
android:layout_gravity="center"
|
||||
android:layout_marginTop="10dp"
|
||||
android:indeterminate="false"
|
||||
android:max="100"
|
||||
android:progressDrawable="@drawable/progress_bar" />
|
||||
|
||||
<Button
|
||||
android:layout_marginTop="20dp"
|
||||
android:id="@+id/set_upload_file"
|
||||
style="@style/Base.Widget.AppCompat.Button.Colored"
|
||||
android:layout_width="wrap_content"
|
||||
@ -93,17 +156,23 @@
|
||||
android:textSize="16sp" />
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
<EditText
|
||||
android:id="@+id/video_title"
|
||||
<com.google.android.material.textfield.TextInputLayout
|
||||
android:layout_width="300dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:layout_marginTop="20dp"
|
||||
android:layout_marginTop="20dp">
|
||||
|
||||
<com.google.android.material.textfield.TextInputEditText
|
||||
android:id="@+id/video_title"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:hint="@string/title_video_peertube"
|
||||
android:importantForAutofill="no"
|
||||
android:inputType="text"
|
||||
android:singleLine="true" />
|
||||
</com.google.android.material.textfield.TextInputLayout>
|
||||
|
||||
|
||||
<!-- Videos upload submit -->
|
||||
<Button
|
||||
@ -118,4 +187,4 @@
|
||||
android:text="@string/upload_video"
|
||||
android:textSize="18sp" />
|
||||
</LinearLayout>
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
</androidx.core.widget.NestedScrollView>
|
||||
|
@ -14,72 +14,45 @@
|
||||
You should have received a copy of the GNU General Public License along with TubeLab; if not,
|
||||
see <http://www.gnu.org/licenses>.
|
||||
-->
|
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
<androidx.coordinatorlayout.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:layout_height="match_parent">
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:fitsSystemWindows="true"
|
||||
tools:context=".ShowChannelActivity">
|
||||
|
||||
<HorizontalScrollView
|
||||
android:id="@+id/history_filter"
|
||||
<com.google.android.material.appbar.AppBarLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="10dp"
|
||||
android:paddingTop="5dp"
|
||||
android:paddingBottom="5dp"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
android:fitsSystemWindows="true"
|
||||
app:theme="@style/ThemeOverlay.AppCompat.ActionBar">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/history_filter_all"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@drawable/background_rounded_item"
|
||||
android:paddingStart="5dp"
|
||||
android:paddingEnd="5dp"
|
||||
android:text="@string/all"
|
||||
android:textColor="?attr/colorAccent" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/history_filter_today"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="5dp"
|
||||
android:background="@drawable/background_rounded_item"
|
||||
android:paddingStart="5dp"
|
||||
android:paddingEnd="5dp"
|
||||
android:text="@string/today"
|
||||
android:textColor="?attr/colorAccent" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/history_filter_last_7_days"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="5dp"
|
||||
android:background="@drawable/background_rounded_item"
|
||||
android:paddingStart="5dp"
|
||||
android:paddingEnd="5dp"
|
||||
android:text="@string/last_7_days"
|
||||
android:textColor="?attr/colorAccent" />
|
||||
</LinearLayout>
|
||||
|
||||
</HorizontalScrollView>
|
||||
|
||||
<RelativeLayout
|
||||
android:id="@+id/container"
|
||||
<com.google.android.material.appbar.CollapsingToolbarLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/history_filter">
|
||||
android:layout_height="wrap_content"
|
||||
android:fitsSystemWindows="true"
|
||||
app:contentScrim="?attr/colorPrimary"
|
||||
app:expandedTitleMarginEnd="64dp"
|
||||
app:expandedTitleMarginStart="48dp"
|
||||
app:layout_scrollFlags="scroll|exitUntilCollapsed">
|
||||
</com.google.android.material.appbar.CollapsingToolbarLayout>
|
||||
|
||||
<com.google.android.material.tabs.TabLayout
|
||||
android:id="@+id/search_tabLayout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
app:tabGravity="fill"
|
||||
app:tabMode="fixed"
|
||||
app:tabSelectedTextColor="?colorAccent"
|
||||
app:tabTextColor="@android:color/white" />
|
||||
</com.google.android.material.appbar.AppBarLayout>
|
||||
|
||||
</RelativeLayout>
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
<androidx.viewpager.widget.ViewPager
|
||||
android:id="@+id/search_pager"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="5dp"
|
||||
app:layout_behavior="@string/appbar_scrolling_view_behavior" />
|
||||
|
||||
</androidx.coordinatorlayout.widget.CoordinatorLayout>
|
||||
|
@ -27,7 +27,8 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:fitsSystemWindows="true"
|
||||
app:theme="@style/ThemeOverlay.AppCompat.Light">
|
||||
app:theme="@style/popupTheme">
|
||||
|
||||
<com.google.android.material.appbar.CollapsingToolbarLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
@ -35,8 +36,9 @@
|
||||
app:contentScrim="?attr/colorPrimary"
|
||||
app:expandedTitleMarginEnd="64dp"
|
||||
app:expandedTitleMarginStart="48dp"
|
||||
android:background="@color/white"
|
||||
android:background="?android:colorBackground"
|
||||
app:layout_scrollFlags="scroll|exitUntilCollapsed">
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_marginStart="@dimen/fab_margin"
|
||||
android:layout_marginEnd="@dimen/fab_margin"
|
||||
@ -50,8 +52,12 @@
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent">
|
||||
<com.mancj.materialsearchbar.MaterialSearchBar
|
||||
style="@style/MaterialSearchBarLight"
|
||||
style="@style/searchBarSepia"
|
||||
app:mt_speechMode="false"
|
||||
app:mt_backIconTint="?attr/colorAccent"
|
||||
app:mt_clearIconTint="?attr/colorAccent"
|
||||
app:mt_menuIconTint="?attr/colorAccent"
|
||||
app:mt_searchIconTint="?attr/colorAccent"
|
||||
app:mt_hint="@string/sepia_search_hint"
|
||||
app:mt_maxSuggestionsCount="10"
|
||||
android:layout_width="match_parent"
|
||||
|
85
app/src/main/res/layout/activity_videos_timeline.xml
Normal file
85
app/src/main/res/layout/activity_videos_timeline.xml
Normal file
@ -0,0 +1,85 @@
|
||||
<?xml version="1.0" encoding="utf-8"?><!--
|
||||
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>.
|
||||
-->
|
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<HorizontalScrollView
|
||||
android:id="@+id/history_filter"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="10dp"
|
||||
android:paddingTop="5dp"
|
||||
android:paddingBottom="5dp"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/history_filter_all"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@drawable/background_rounded_item"
|
||||
android:paddingStart="5dp"
|
||||
android:paddingEnd="5dp"
|
||||
android:text="@string/all"
|
||||
android:textColor="?attr/colorAccent" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/history_filter_today"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="5dp"
|
||||
android:background="@drawable/background_rounded_item"
|
||||
android:paddingStart="5dp"
|
||||
android:paddingEnd="5dp"
|
||||
android:text="@string/today"
|
||||
android:textColor="?attr/colorAccent" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/history_filter_last_7_days"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="5dp"
|
||||
android:background="@drawable/background_rounded_item"
|
||||
android:paddingStart="5dp"
|
||||
android:paddingEnd="5dp"
|
||||
android:text="@string/last_7_days"
|
||||
android:textColor="?attr/colorAccent" />
|
||||
</LinearLayout>
|
||||
|
||||
</HorizontalScrollView>
|
||||
|
||||
<RelativeLayout
|
||||
android:id="@+id/container"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/history_filter">
|
||||
|
||||
|
||||
</RelativeLayout>
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
@ -24,6 +24,30 @@
|
||||
android:orientation="vertical"
|
||||
android:padding="15dp">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/profile_picture"
|
||||
android:layout_width="80dp"
|
||||
android:layout_height="80dp"
|
||||
android:layout_marginStart="20dp"
|
||||
android:contentDescription="@string/profile_picture" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/select_file"
|
||||
style="@style/Widget.AppCompat.Button.Borderless"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:layout_marginStart="10dp"
|
||||
android:singleLine="true"
|
||||
android:text="@string/change_profile_picture"
|
||||
android:textColor="?attr/colorAccent" />
|
||||
</LinearLayout>
|
||||
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
@ -71,6 +95,8 @@
|
||||
android:importantForAutofill="no"
|
||||
android:inputType="text"
|
||||
android:maxLines="5" />
|
||||
|
||||
|
||||
</LinearLayout>
|
||||
</ScrollView>
|
||||
|
||||
|
@ -20,6 +20,30 @@
|
||||
android:orientation="vertical"
|
||||
android:padding="15dp">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/profile_picture"
|
||||
android:layout_width="80dp"
|
||||
android:layout_height="80dp"
|
||||
android:layout_marginStart="20dp"
|
||||
android:contentDescription="@string/profile_picture" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/select_file"
|
||||
style="@style/Widget.AppCompat.Button.Borderless"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:layout_marginStart="10dp"
|
||||
android:singleLine="true"
|
||||
android:text="@string/change_profile_picture"
|
||||
android:textColor="?attr/colorAccent" />
|
||||
</LinearLayout>
|
||||
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
|
@ -20,31 +20,34 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:divider="?android:dividerHorizontal"
|
||||
android:orientation="vertical"
|
||||
android:orientation="horizontal"
|
||||
android:clickable="true"
|
||||
android:showDividers="end"
|
||||
android:focusable="true">
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
<View
|
||||
android:id="@+id/decoration"
|
||||
android:layout_width="2dp"
|
||||
android:layout_height="0dp"
|
||||
android:background="?attr/colorAccent"
|
||||
<LinearLayout
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="horizontal"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
android:id="@+id/decoration_container"
|
||||
android:layout_width="wrap_content"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_height="wrap_content"
|
||||
android:id="@+id/sub_comment_container"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_marginStart="10dp">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/comment_account_profile"
|
||||
android:layout_width="40dp"
|
||||
android:layout_height="40dp"
|
||||
android:layout_marginTop="5dp"
|
||||
android:layout_marginStart="10dp"
|
||||
android:src="@drawable/missing_peertube"
|
||||
android:contentDescription="@string/profile_picture"
|
||||
app:layout_constraintStart_toStartOf="@id/decoration"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<TextView
|
||||
@ -108,7 +111,7 @@
|
||||
<TextView
|
||||
android:id="@+id/number_of_replies"
|
||||
app:layout_constraintTop_toBottomOf="@+id/comment_content"
|
||||
app:layout_constraintStart_toStartOf="@id/decoration"
|
||||
app:layout_constraintStart_toStartOf="@id/comment_account_profile"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textColor="?attr/colorAccent"/>
|
||||
@ -139,4 +142,5 @@
|
||||
app:layout_constraintTop_toBottomOf="@+id/comment_content" />
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
|
||||
</LinearLayout>
|
||||
|
34
app/src/main/res/layout/drawer_menu.xml
Normal file
34
app/src/main/res/layout/drawer_menu.xml
Normal file
@ -0,0 +1,34 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:id="@+id/item_menu_container"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_marginTop="10dp"
|
||||
android:clickable="true"
|
||||
android:focusable="true"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/menu_icon"
|
||||
android:layout_width="24dp"
|
||||
android:layout_height="24dp"
|
||||
android:gravity="center"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
tools:ignore="ContentDescription" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/title"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="10dp"
|
||||
android:gravity="start|center_vertical"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
android:ellipsize="end"
|
||||
android:singleLine="true"
|
||||
app:layout_constraintStart_toEndOf="@+id/menu_icon"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
34
app/src/main/res/layout/drawer_menu_item.xml
Normal file
34
app/src/main/res/layout/drawer_menu_item.xml
Normal file
@ -0,0 +1,34 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:id="@+id/item_menu_container"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="10dp"
|
||||
android:clickable="true"
|
||||
android:focusable="true">
|
||||
|
||||
<RadioButton
|
||||
android:id="@+id/radio"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<TextView
|
||||
android:labelFor="@+id/radio"
|
||||
android:id="@+id/title"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="10dp"
|
||||
android:gravity="start|center_vertical"
|
||||
android:ellipsize="end"
|
||||
android:singleLine="true"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toEndOf="@+id/radio"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
tools:ignore="LabelFor" />
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
@ -9,29 +9,36 @@
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
-->
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:id="@+id/mainMediaControllerContainer"
|
||||
android:layout_gravity="bottom"
|
||||
android:background="#CC000000"
|
||||
android:layoutDirection="ltr"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical">
|
||||
|
||||
<ImageButton
|
||||
android:id="@id/exo_settings"
|
||||
style="@style/ExoStyledControls.Button.Bottom.Settings"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<LinearLayout
|
||||
android:orientation="horizontal"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center"
|
||||
android:orientation="horizontal"
|
||||
android:paddingTop="4dp">
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
|
||||
<ImageButton
|
||||
android:id="@id/exo_prev"
|
||||
style="@style/ExoMediaButton.Previous" />
|
||||
|
||||
<ImageButton
|
||||
android:id="@id/exo_rew"
|
||||
style="@style/ExoMediaButton.Rewind" />
|
||||
|
||||
|
||||
<ImageButton
|
||||
android:id="@id/exo_play"
|
||||
@ -41,9 +48,6 @@
|
||||
android:id="@id/exo_pause"
|
||||
style="@style/ExoMediaButton.Pause" />
|
||||
|
||||
<ImageButton
|
||||
android:id="@id/exo_ffwd"
|
||||
style="@style/ExoMediaButton.FastForward" />
|
||||
|
||||
<ImageButton
|
||||
android:id="@id/exo_next"
|
||||
@ -52,6 +56,10 @@
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/seekbar_controller"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="4dp"
|
||||
@ -103,8 +111,8 @@
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/exo_fullscreen_icon"
|
||||
android:layout_width="18dp"
|
||||
android:layout_height="18dp"
|
||||
android:layout_width="24dp"
|
||||
android:layout_height="24dp"
|
||||
android:layout_gravity="center"
|
||||
android:adjustViewBounds="true"
|
||||
android:contentDescription="@string/fullscreen"
|
||||
@ -113,4 +121,4 @@
|
||||
</FrameLayout>
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
@ -68,7 +68,7 @@
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/lv_status"
|
||||
android:id="@+id/lv_videos"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:scrollbars="none" />
|
||||
@ -109,7 +109,7 @@
|
||||
</RelativeLayout>
|
||||
<!-- Loader for next videos -->
|
||||
<RelativeLayout
|
||||
android:id="@+id/loading_next_status"
|
||||
android:id="@+id/loading_next_videos"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="20dp"
|
||||
android:layout_alignParentBottom="true"
|
||||
|
@ -1,4 +1,19 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<?xml version="1.0" encoding="utf-8"?><!--
|
||||
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>.
|
||||
-->
|
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:layout_width="match_parent"
|
||||
|
@ -1,4 +1,19 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<?xml version="1.0" encoding="utf-8"?><!--
|
||||
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>.
|
||||
-->
|
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:layout_width="match_parent"
|
||||
|
160
app/src/main/res/layout/popup_video_info.xml
Normal file
160
app/src/main/res/layout/popup_video_info.xml
Normal file
@ -0,0 +1,160 @@
|
||||
<?xml version="1.0" encoding="utf-8"?><!--
|
||||
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>.
|
||||
-->
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical"
|
||||
android:padding="@dimen/popup_padding">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<TextView
|
||||
android:layout_width="170dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:singleLine="true"
|
||||
android:text="@string/action_privacy" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/info_privacy"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:singleLine="true" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="5dp"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<TextView
|
||||
android:layout_width="170dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:singleLine="true"
|
||||
android:text="@string/originally_published" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/info_published_at"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:singleLine="true" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="5dp"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<TextView
|
||||
android:layout_width="170dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:singleLine="true"
|
||||
android:text="@string/category" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/info_category"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:singleLine="true" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="5dp"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<TextView
|
||||
android:layout_width="170dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:singleLine="true"
|
||||
android:text="@string/license" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/info_license"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:singleLine="true" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="5dp"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<TextView
|
||||
android:layout_width="170dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:singleLine="true"
|
||||
android:text="@string/language" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/info_language"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:singleLine="true" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="5dp"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<TextView
|
||||
android:layout_width="170dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:singleLine="true"
|
||||
android:text="@string/tags" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/info_tags"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="5dp"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<TextView
|
||||
android:layout_width="170dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:singleLine="true"
|
||||
android:text="@string/sepia_element_duration" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/info_duration"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:singleLine="true" />
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
@ -11,11 +11,6 @@
|
||||
android:icon="@drawable/ic_baseline_cloud_download_24"
|
||||
android:title="@string/download"
|
||||
app:showAsAction="ifRoom" />
|
||||
<item
|
||||
android:id="@+id/action_captions"
|
||||
android:icon="@drawable/ic_baseline_subtitles_24"
|
||||
android:title="@string/captions"
|
||||
app:showAsAction="ifRoom" />
|
||||
<item
|
||||
android:id="@+id/action_edit"
|
||||
android:icon="@drawable/ic_baseline_edit_24"
|
||||
|
@ -1,6 +1,6 @@
|
||||
<resources>
|
||||
|
||||
|
||||
<attr name="backgroundView" format="color" />
|
||||
<!-- Base application theme. -->
|
||||
<style name="AppTheme" parent="Theme.AppCompat.DayNight.DarkActionBar">
|
||||
<!-- Customize your theme here. -->
|
||||
@ -8,7 +8,9 @@
|
||||
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
|
||||
<item name="colorAccent">@color/colorAccent</item>
|
||||
<item name="android:textColor">?attr/colorOnBackground</item>
|
||||
|
||||
<item name="backgroundView">@color/backgroundDark</item>
|
||||
<item name="android:windowBackground">@android:color/black</item>
|
||||
<item name="android:colorBackground">@android:color/black</item>
|
||||
</style>
|
||||
|
||||
<style name="AppThemeNoActionBar" parent="Theme.AppCompat.DayNight.NoActionBar">
|
||||
@ -16,13 +18,19 @@
|
||||
<item name="colorPrimary">@color/colorPrimary</item>
|
||||
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
|
||||
<item name="colorAccent">@color/colorAccent</item>
|
||||
|
||||
<item name="backgroundView">@color/backgroundDark</item>
|
||||
<item name="android:textColor">?attr/colorOnBackground</item>
|
||||
<item name="android:windowBackground">@android:color/black</item>
|
||||
<item name="android:colorBackground">@android:color/black</item>
|
||||
</style>
|
||||
|
||||
<style name="theme" parent="@style/ThemeOverlay.AppCompat.Dark" />
|
||||
|
||||
<style name="popupTheme" parent="@style/ThemeOverlay.AppCompat.Dark" />
|
||||
|
||||
<style name="progress" parent="SpinKitView.Circle" />
|
||||
|
||||
<style name="progressBottom" parent="SpinKitView.ThreeBounce" />
|
||||
|
||||
<style name="searchBarSepia" parent="MaterialSearchBarDark" />
|
||||
</resources>
|
@ -1,5 +1,5 @@
|
||||
<resources>
|
||||
|
||||
<attr name="backgroundView" format="color" />
|
||||
|
||||
<!-- Base application theme. -->
|
||||
<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
|
||||
@ -8,6 +8,7 @@
|
||||
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
|
||||
<item name="colorAccent">@color/colorAccent</item>
|
||||
<item name="android:textColor">?attr/colorOnBackground</item>
|
||||
<item name="backgroundView">@color/white</item>
|
||||
</style>
|
||||
|
||||
<style name="AppThemeNoActionBar" parent="Theme.AppCompat.Light.NoActionBar">
|
||||
@ -15,13 +16,18 @@
|
||||
<item name="colorPrimary">@color/colorPrimary</item>
|
||||
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
|
||||
<item name="colorAccent">@color/colorAccent</item>
|
||||
|
||||
<item name="android:textColor">?attr/colorOnBackground</item>
|
||||
<item name="backgroundView">@color/white</item>
|
||||
</style>
|
||||
|
||||
<style name="theme" parent="@style/ThemeOverlay.AppCompat.Dark" />
|
||||
|
||||
<style name="popupTheme" parent="@style/ThemeOverlay.AppCompat.Light" />
|
||||
|
||||
<style name="progress" parent="SpinKitView.Circle" />
|
||||
|
||||
<style name="progressBottom" parent="SpinKitView.ThreeBounce" />
|
||||
|
||||
<style name="searchBarSepia" parent="MaterialSearchBarLight" />
|
||||
|
||||
</resources>
|
Reference in New Issue
Block a user