mirror of
https://framagit.org/tom79/fedilab-tube
synced 2025-06-05 21:09:11 +02:00
Compare commits
26 Commits
Author | SHA1 | Date | |
---|---|---|---|
017bd5a6a2 | |||
967f11ddb4 | |||
6b4abd019e | |||
8b66c4030f | |||
34f058358e | |||
2bab907777 | |||
52e64b6d85 | |||
9510678a9f | |||
b4e7c3f8e2 | |||
d800d2b10c | |||
785b4949e6 | |||
b79e17cb60 | |||
19fcbeb4b9 | |||
ffb355d1a2 | |||
43fd2945cc | |||
d93c74a449 | |||
7a197993c9 | |||
dc2a252dd5 | |||
2c33f7a7f8 | |||
24a8a0dc00 | |||
b78894b33c | |||
2d33d7f970 | |||
8823eb74ba | |||
7f77b86272 | |||
2f773b2f0f | |||
ca69a6e86d |
@ -6,12 +6,13 @@ android {
|
|||||||
compileSdkVersion 30
|
compileSdkVersion 30
|
||||||
buildToolsVersion "30.0.2"
|
buildToolsVersion "30.0.2"
|
||||||
|
|
||||||
|
|
||||||
defaultConfig {
|
defaultConfig {
|
||||||
|
|
||||||
minSdkVersion 21
|
minSdkVersion 21
|
||||||
targetSdkVersion 30
|
targetSdkVersion 30
|
||||||
versionCode 17
|
versionCode 19
|
||||||
versionName "1.4.2"
|
versionName "1.5.0"
|
||||||
multiDexEnabled true
|
multiDexEnabled true
|
||||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||||
}
|
}
|
||||||
@ -30,6 +31,10 @@ android {
|
|||||||
targetCompatibility JavaVersion.VERSION_1_8
|
targetCompatibility JavaVersion.VERSION_1_8
|
||||||
}
|
}
|
||||||
|
|
||||||
|
buildFeatures {
|
||||||
|
viewBinding = true
|
||||||
|
}
|
||||||
|
|
||||||
lintOptions {
|
lintOptions {
|
||||||
disable 'MissingTranslation'
|
disable 'MissingTranslation'
|
||||||
checkReleaseBuilds false
|
checkReleaseBuilds false
|
||||||
@ -122,5 +127,6 @@ dependencies {
|
|||||||
implementation 'com.github.mancj:MaterialSearchBar:0.8.5'
|
implementation 'com.github.mancj:MaterialSearchBar:0.8.5'
|
||||||
|
|
||||||
implementation "io.github.kobakei:ratethisapp:1.2.0"
|
implementation "io.github.kobakei:ratethisapp:1.2.0"
|
||||||
|
implementation 'com.github.HITGIF:TextFieldBoxes:1.4.5'
|
||||||
|
|
||||||
}
|
}
|
@ -16,6 +16,13 @@
|
|||||||
<item>Automatique</item>
|
<item>Automatique</item>
|
||||||
</string-array>
|
</string-array>
|
||||||
|
|
||||||
|
|
||||||
|
<plurals name="number_of_replies">
|
||||||
|
<item quantity="zero">%d réponse</item>
|
||||||
|
<item quantity="one">%d réponse</item>
|
||||||
|
<item quantity="other">%d réponses</item>
|
||||||
|
</plurals>
|
||||||
|
|
||||||
<string name="set_theme">Thème</string>
|
<string name="set_theme">Thème</string>
|
||||||
<string name="set_theme_description">Permet de changer le thème de l\'application</string>
|
<string name="set_theme_description">Permet de changer le thème de l\'application</string>
|
||||||
<string name="federation_issue">La vidéo ne peut pas être fédérée !</string>
|
<string name="federation_issue">La vidéo ne peut pas être fédérée !</string>
|
||||||
@ -177,8 +184,12 @@
|
|||||||
<string name="peertube_video_unblacklist"><![CDATA[Votre vidéo <b>%1$s</b> n’est plus blacklisté]]></string>
|
<string name="peertube_video_unblacklist"><![CDATA[Votre vidéo <b>%1$s</b> n’est plus blacklisté]]></string>
|
||||||
<string name="peertube_video_abuse"><![CDATA[Nouveau signalement pour la vidéo : <b>%1$s</b>]]></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="add_public_comment">Ajouter un commentaire public</string>
|
||||||
|
<string name="add_public_reply">Répondre publiquement</string>
|
||||||
<string name="send_comment">Envoyer un commentaire</string>
|
<string name="send_comment">Envoyer un commentaire</string>
|
||||||
<string name="all">Tout</string>
|
<string name="all">Tout</string>
|
||||||
|
|
||||||
|
<string name="peertube_video_report_success"><![CDATA[ Votre signalement <b>%1$s</b> a été accepté]]></string>
|
||||||
|
<string name="reply">Répondre</string>
|
||||||
<!-- end languages -->
|
<!-- end languages -->
|
||||||
<string name="playlists">Listes de lecture</string>
|
<string name="playlists">Listes de lecture</string>
|
||||||
<string name="display_name">Nom d\'affichage</string>
|
<string name="display_name">Nom d\'affichage</string>
|
||||||
|
@ -1,22 +1,22 @@
|
|||||||
*Nie ma trybu uwierzytelnionego*
|
*Tryb bez uwierzytelniania*
|
||||||
|
|
||||||
Jest to tryb ograniczony, w którym można wykonywać pewne czynności:
|
Jest to tryb ograniczony, w którym można wykonywać niektóre czynności:
|
||||||
|
|
||||||
- Przełącznik,
|
- Przełączać sesje,
|
||||||
- Podziel się filmami,
|
- Udostępniać filmy,
|
||||||
- Pobierz filmy.
|
- Pobierać filmy.
|
||||||
|
|
||||||
|
|
||||||
*Tryb uwierzytelniony*
|
*Tryb uwierzytelniony*
|
||||||
|
|
||||||
W tym trybie dostępnych jest wiele funkcji:
|
W tym trybie dostępnych jest wiele funkcji:
|
||||||
|
|
||||||
- Napisać/usunąć komentarz
|
- Pisanie/Usuwanie komentarzy
|
||||||
- Przesyłanie/usuwanie/edycja filmów
|
- Przesyłanie/Usuwanie/Edytowanie filmów
|
||||||
- Zarządzanie (tworzenie/edycja/usuwanie) kanałami i listami odtwarzania
|
- Zarządzanie (tworzenie/edytowanie/usuwanie) kanałami i listami odtwarzania
|
||||||
- Kanały podążające/niepodążające
|
- Obserwowanie kanałów
|
||||||
- Kciuki w górę/w dół
|
- Kciuki w górę/w dół
|
||||||
- Powiadomienia o kontroli
|
- Sprawdzanie powiadomień
|
||||||
- Kanały wyciszone/niewyciszone
|
- Wyciszanie kanałów
|
||||||
- Raporty wideo/rachunki
|
- Zgłaszanie filmów/kont
|
||||||
- Sprawdź swoją historię
|
- Sprawdzanie swojej historii
|
@ -1 +1 @@
|
|||||||
App for all Peertube instances
|
Aplikacja dla wszystkich instancji PeerTube
|
@ -15,7 +15,7 @@
|
|||||||
- Загружать/удалять/редактировать видео
|
- Загружать/удалять/редактировать видео
|
||||||
- Управлять (создание/редактирование/удаление) каналами и плейлистами
|
- Управлять (создание/редактирование/удаление) каналами и плейлистами
|
||||||
- Подписаться/отписаться от каналов
|
- Подписаться/отписаться от каналов
|
||||||
- Палец вверх/вниз
|
- Нравится/не нравится
|
||||||
- Проверить уведомления
|
- Проверить уведомления
|
||||||
- Отключить/включить каналы
|
- Отключить/включить каналы
|
||||||
- Пожаловаться на видео/аккаунты
|
- Пожаловаться на видео/аккаунты
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
- Theme: Light, Dark and auto
|
- Custom default instance depending of the country
|
||||||
- Remove all comments of an account on your videos
|
- See replies to comments
|
||||||
- Sepia search: Allow interactions when the video is federated
|
- Reply to comments
|
||||||
- Mute accounts from comments
|
- Reply to replies
|
||||||
- Links clickable in video descriptions
|
- See accounts (displays their channels & videos)
|
||||||
- Fix all comments not displayed
|
- Fix some issues when posting
|
||||||
- Fix some minor other bugs
|
- Fix videos not paused after screen lock
|
@ -1,5 +1,15 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<resources xmlns:tools="http://schemas.android.com/tools">
|
<resources xmlns:tools="http://schemas.android.com/tools">
|
||||||
|
<string name="add_public_reply">Add a public reply</string>
|
||||||
|
<plurals name="number_of_replies">
|
||||||
|
<item quantity="zero">%d replies</item>
|
||||||
|
<item quantity="one">%d reply</item>
|
||||||
|
<item quantity="two">%d replies</item>
|
||||||
|
<item quantity="few">%d replies</item>
|
||||||
|
<item quantity="many">%d replies</item>
|
||||||
|
<item quantity="other">%d replies</item>
|
||||||
|
</plurals>
|
||||||
|
<string name="reply">Reply</string>
|
||||||
<string name="set_theme">Theme</string>
|
<string name="set_theme">Theme</string>
|
||||||
<string name="set_theme_description">Allow to change app theme</string>
|
<string name="set_theme_description">Allow to change app theme</string>
|
||||||
<string name="federation_issue">The video cannot be federated!</string>
|
<string name="federation_issue">The video cannot be federated!</string>
|
||||||
@ -161,6 +171,7 @@
|
|||||||
<string name="peertube_video_from_subscription"><![CDATA[<b>%1$s</b> published a new video: <b>%2$s</b>]]></string>
|
<string name="peertube_video_from_subscription"><![CDATA[<b>%1$s</b> published a new video: <b>%2$s</b>]]></string>
|
||||||
<string name="peertube_video_blacklist"><![CDATA[Your video <b>%1$s</b> has been blacklisted]]></string>
|
<string name="peertube_video_blacklist"><![CDATA[Your video <b>%1$s</b> has been blacklisted]]></string>
|
||||||
<string name="peertube_video_unblacklist"><![CDATA[Your video <b>%1$s</b> has been unblacklisted]]></string>
|
<string name="peertube_video_unblacklist"><![CDATA[Your video <b>%1$s</b> has been unblacklisted]]></string>
|
||||||
|
<string name="peertube_video_report_success"><![CDATA[ Your abuse <b>%1$s</b> has been accepted]]></string>
|
||||||
<string name="peertube_video_abuse"><![CDATA[New abuse report for video: <b>%1$s</b>]]></string>
|
<string name="peertube_video_abuse"><![CDATA[New abuse report for video: <b>%1$s</b>]]></string>
|
||||||
<string name="add_public_comment">Add a public comment</string>
|
<string name="add_public_comment">Add a public comment</string>
|
||||||
<string name="send_comment">Send comment</string>
|
<string name="send_comment">Send comment</string>
|
||||||
|
@ -1,5 +1,11 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<resources xmlns:tools="http://schemas.android.com/tools">
|
<resources xmlns:tools="http://schemas.android.com/tools">
|
||||||
|
<string name="add_public_reply">Add a public reply</string>
|
||||||
|
<plurals name="number_of_replies">
|
||||||
|
<item quantity="one">%d reply</item>
|
||||||
|
<item quantity="other">%d replies</item>
|
||||||
|
</plurals>
|
||||||
|
<string name="reply">Reply</string>
|
||||||
<string name="set_theme">Theme</string>
|
<string name="set_theme">Theme</string>
|
||||||
<string name="set_theme_description">Allow to change app theme</string>
|
<string name="set_theme_description">Allow to change app theme</string>
|
||||||
<string name="federation_issue">The video cannot be federated!</string>
|
<string name="federation_issue">The video cannot be federated!</string>
|
||||||
@ -161,6 +167,7 @@
|
|||||||
<string name="peertube_video_from_subscription"><![CDATA[<b>%1$s</b> hat ein neues Video veröffentlicht: <b>%2$s</b>]]></string>
|
<string name="peertube_video_from_subscription"><![CDATA[<b>%1$s</b> hat ein neues Video veröffentlicht: <b>%2$s</b>]]></string>
|
||||||
<string name="peertube_video_blacklist"><![CDATA[Dein Video <b>%1$s</b> wurde gesperrt]]></string>
|
<string name="peertube_video_blacklist"><![CDATA[Dein Video <b>%1$s</b> wurde gesperrt]]></string>
|
||||||
<string name="peertube_video_unblacklist"><![CDATA[Die Sperre für dein Video <b>%1$s</b> wurde aufgehoben]]></string>
|
<string name="peertube_video_unblacklist"><![CDATA[Die Sperre für dein Video <b>%1$s</b> wurde aufgehoben]]></string>
|
||||||
|
<string name="peertube_video_report_success"><![CDATA[ Your abuse <b>%1$s</b> has been accepted]]></string>
|
||||||
<string name="peertube_video_abuse"><![CDATA[New abuse report for video: <b>%1$s</b>]]></string>
|
<string name="peertube_video_abuse"><![CDATA[New abuse report for video: <b>%1$s</b>]]></string>
|
||||||
<string name="add_public_comment">Öffentlichen Kommentar hinzufügen</string>
|
<string name="add_public_comment">Öffentlichen Kommentar hinzufügen</string>
|
||||||
<string name="send_comment">Kommentar absenden</string>
|
<string name="send_comment">Kommentar absenden</string>
|
||||||
|
@ -1,5 +1,11 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<resources xmlns:tools="http://schemas.android.com/tools">
|
<resources xmlns:tools="http://schemas.android.com/tools">
|
||||||
|
<string name="add_public_reply">Add a public reply</string>
|
||||||
|
<plurals name="number_of_replies">
|
||||||
|
<item quantity="one">%d reply</item>
|
||||||
|
<item quantity="other">%d replies</item>
|
||||||
|
</plurals>
|
||||||
|
<string name="reply">Reply</string>
|
||||||
<string name="set_theme">Theme</string>
|
<string name="set_theme">Theme</string>
|
||||||
<string name="set_theme_description">Allow to change app theme</string>
|
<string name="set_theme_description">Allow to change app theme</string>
|
||||||
<string name="federation_issue">The video cannot be federated!</string>
|
<string name="federation_issue">The video cannot be federated!</string>
|
||||||
@ -161,6 +167,7 @@
|
|||||||
<string name="peertube_video_from_subscription"><![CDATA[<b>%1$s</b> Δημοσίευσε ένα νέο βίντεο: <b>%2$s</b>]]></string>
|
<string name="peertube_video_from_subscription"><![CDATA[<b>%1$s</b> Δημοσίευσε ένα νέο βίντεο: <b>%2$s</b>]]></string>
|
||||||
<string name="peertube_video_blacklist"><![CDATA[Το βίντεό σου <b>%1$s</b> έχει μπει στη μαύρη λίστα]]></string>
|
<string name="peertube_video_blacklist"><![CDATA[Το βίντεό σου <b>%1$s</b> έχει μπει στη μαύρη λίστα]]></string>
|
||||||
<string name="peertube_video_unblacklist"><![CDATA[Το βίντεό σου <b>%1$s</b> έχει βγει από τη μαύρη λίστα]]></string>
|
<string name="peertube_video_unblacklist"><![CDATA[Το βίντεό σου <b>%1$s</b> έχει βγει από τη μαύρη λίστα]]></string>
|
||||||
|
<string name="peertube_video_report_success"><![CDATA[ Your abuse <b>%1$s</b> has been accepted]]></string>
|
||||||
<string name="peertube_video_abuse"><![CDATA[New abuse report for video: <b>%1$s</b>]]></string>
|
<string name="peertube_video_abuse"><![CDATA[New abuse report for video: <b>%1$s</b>]]></string>
|
||||||
<string name="add_public_comment">Προσθήκη ενός δημόσιου σχόλιου</string>
|
<string name="add_public_comment">Προσθήκη ενός δημόσιου σχόλιου</string>
|
||||||
<string name="send_comment">Αποστολή σχόλιου</string>
|
<string name="send_comment">Αποστολή σχόλιου</string>
|
||||||
|
@ -1,5 +1,11 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<resources xmlns:tools="http://schemas.android.com/tools">
|
<resources xmlns:tools="http://schemas.android.com/tools">
|
||||||
|
<string name="add_public_reply">Add a public reply</string>
|
||||||
|
<plurals name="number_of_replies">
|
||||||
|
<item quantity="one">%d reply</item>
|
||||||
|
<item quantity="other">%d replies</item>
|
||||||
|
</plurals>
|
||||||
|
<string name="reply">Reply</string>
|
||||||
<string name="set_theme">Theme</string>
|
<string name="set_theme">Theme</string>
|
||||||
<string name="set_theme_description">Allow to change app theme</string>
|
<string name="set_theme_description">Allow to change app theme</string>
|
||||||
<string name="federation_issue">The video cannot be federated!</string>
|
<string name="federation_issue">The video cannot be federated!</string>
|
||||||
@ -161,6 +167,7 @@
|
|||||||
<string name="peertube_video_from_subscription"><![CDATA[<b>%1$s</b> publicó un nuevo video: <b>%2$s</b>]]></string>
|
<string name="peertube_video_from_subscription"><![CDATA[<b>%1$s</b> publicó un nuevo video: <b>%2$s</b>]]></string>
|
||||||
<string name="peertube_video_blacklist"><![CDATA[Su video <b>%1$s</b> esta en lista negra]]></string>
|
<string name="peertube_video_blacklist"><![CDATA[Su video <b>%1$s</b> esta en lista negra]]></string>
|
||||||
<string name="peertube_video_unblacklist"><![CDATA[Tu video <b>%1$s</b> non más esta en lista negra]]></string>
|
<string name="peertube_video_unblacklist"><![CDATA[Tu video <b>%1$s</b> non más esta en lista negra]]></string>
|
||||||
|
<string name="peertube_video_report_success"><![CDATA[ Your abuse <b>%1$s</b> has been accepted]]></string>
|
||||||
<string name="peertube_video_abuse"><![CDATA[New abuse report for video: <b>%1$s</b>]]></string>
|
<string name="peertube_video_abuse"><![CDATA[New abuse report for video: <b>%1$s</b>]]></string>
|
||||||
<string name="add_public_comment">Añade un comentario público</string>
|
<string name="add_public_comment">Añade un comentario público</string>
|
||||||
<string name="send_comment">Enviar comentario</string>
|
<string name="send_comment">Enviar comentario</string>
|
||||||
|
@ -1,5 +1,11 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<resources xmlns:tools="http://schemas.android.com/tools">
|
<resources xmlns:tools="http://schemas.android.com/tools">
|
||||||
|
<string name="add_public_reply">Add a public reply</string>
|
||||||
|
<plurals name="number_of_replies">
|
||||||
|
<item quantity="one">%d reply</item>
|
||||||
|
<item quantity="other">%d replies</item>
|
||||||
|
</plurals>
|
||||||
|
<string name="reply">Reply</string>
|
||||||
<string name="set_theme">Theme</string>
|
<string name="set_theme">Theme</string>
|
||||||
<string name="set_theme_description">Allow to change app theme</string>
|
<string name="set_theme_description">Allow to change app theme</string>
|
||||||
<string name="federation_issue">The video cannot be federated!</string>
|
<string name="federation_issue">The video cannot be federated!</string>
|
||||||
@ -161,6 +167,7 @@
|
|||||||
<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_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_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_unblacklist"><![CDATA[Votre vidéo <b>%1$s</b> n’est plus blacklisté]]></string>
|
||||||
|
<string name="peertube_video_report_success"><![CDATA[ Your abuse <b>%1$s</b> has been accepted]]></string>
|
||||||
<string name="peertube_video_abuse"><![CDATA[Nouveau signalement pour la vidéo : <b>%1$s</b>]]></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="add_public_comment">Ajouter un commentaire public</string>
|
||||||
<string name="send_comment">Envoyer un commentaire</string>
|
<string name="send_comment">Envoyer un commentaire</string>
|
||||||
|
@ -1,5 +1,11 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<resources xmlns:tools="http://schemas.android.com/tools">
|
<resources xmlns:tools="http://schemas.android.com/tools">
|
||||||
|
<string name="add_public_reply">Add a public reply</string>
|
||||||
|
<plurals name="number_of_replies">
|
||||||
|
<item quantity="one">%d reply</item>
|
||||||
|
<item quantity="other">%d replies</item>
|
||||||
|
</plurals>
|
||||||
|
<string name="reply">Reply</string>
|
||||||
<string name="set_theme">Theme</string>
|
<string name="set_theme">Theme</string>
|
||||||
<string name="set_theme_description">Allow to change app theme</string>
|
<string name="set_theme_description">Allow to change app theme</string>
|
||||||
<string name="federation_issue">The video cannot be federated!</string>
|
<string name="federation_issue">The video cannot be federated!</string>
|
||||||
@ -161,6 +167,7 @@
|
|||||||
<string name="peertube_video_from_subscription"><![CDATA[<b>%1$s</b> ha pubblicato un nuovo video: <b>%2$s</b>]]></string>
|
<string name="peertube_video_from_subscription"><![CDATA[<b>%1$s</b> ha pubblicato un nuovo video: <b>%2$s</b>]]></string>
|
||||||
<string name="peertube_video_blacklist"><![CDATA[Il tuo video <b>%1$s</b> è stato messo nella lista nera]]></string>
|
<string name="peertube_video_blacklist"><![CDATA[Il tuo video <b>%1$s</b> è stato messo nella lista nera]]></string>
|
||||||
<string name="peertube_video_unblacklist"><![CDATA[Il tuo video <b>%1$s</b> è stato rimosso dalla lista nera]]></string>
|
<string name="peertube_video_unblacklist"><![CDATA[Il tuo video <b>%1$s</b> è stato rimosso dalla lista nera]]></string>
|
||||||
|
<string name="peertube_video_report_success"><![CDATA[ Your abuse <b>%1$s</b> has been accepted]]></string>
|
||||||
<string name="peertube_video_abuse"><![CDATA[Nuovo rapporto di abuso per il video: <b>%1$s</b>]]></string>
|
<string name="peertube_video_abuse"><![CDATA[Nuovo rapporto di abuso per il video: <b>%1$s</b>]]></string>
|
||||||
<string name="add_public_comment">Aggiungi un commento pubblico</string>
|
<string name="add_public_comment">Aggiungi un commento pubblico</string>
|
||||||
<string name="send_comment">Invia commento</string>
|
<string name="send_comment">Invia commento</string>
|
||||||
|
@ -1,5 +1,10 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<resources xmlns:tools="http://schemas.android.com/tools">
|
<resources xmlns:tools="http://schemas.android.com/tools">
|
||||||
|
<string name="add_public_reply">Add a public reply</string>
|
||||||
|
<plurals name="number_of_replies">
|
||||||
|
<item quantity="other">%d replies</item>
|
||||||
|
</plurals>
|
||||||
|
<string name="reply">Reply</string>
|
||||||
<string name="set_theme">Theme</string>
|
<string name="set_theme">Theme</string>
|
||||||
<string name="set_theme_description">Allow to change app theme</string>
|
<string name="set_theme_description">Allow to change app theme</string>
|
||||||
<string name="federation_issue">The video cannot be federated!</string>
|
<string name="federation_issue">The video cannot be federated!</string>
|
||||||
@ -161,6 +166,7 @@
|
|||||||
<string name="peertube_video_from_subscription"><![CDATA[<b>%1$s</b>が新しい動画を投稿しました: <b>%2$s</b>]]></string>
|
<string name="peertube_video_from_subscription"><![CDATA[<b>%1$s</b>が新しい動画を投稿しました: <b>%2$s</b>]]></string>
|
||||||
<string name="peertube_video_blacklist"><![CDATA[<b>%1$s</b>がブラックリストに追加されました]]></string>
|
<string name="peertube_video_blacklist"><![CDATA[<b>%1$s</b>がブラックリストに追加されました]]></string>
|
||||||
<string name="peertube_video_unblacklist"><![CDATA[<b>%1$s</b>がブラックリストから外されました]]></string>
|
<string name="peertube_video_unblacklist"><![CDATA[<b>%1$s</b>がブラックリストから外されました]]></string>
|
||||||
|
<string name="peertube_video_report_success"><![CDATA[ Your abuse <b>%1$s</b> has been accepted]]></string>
|
||||||
<string name="peertube_video_abuse"><![CDATA[New abuse report for video: <b>%1$s</b>]]></string>
|
<string name="peertube_video_abuse"><![CDATA[New abuse report for video: <b>%1$s</b>]]></string>
|
||||||
<string name="add_public_comment">パブリックコメントを追加</string>
|
<string name="add_public_comment">パブリックコメントを追加</string>
|
||||||
<string name="send_comment">コメントを送信</string>
|
<string name="send_comment">コメントを送信</string>
|
||||||
|
@ -1,5 +1,10 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<resources xmlns:tools="http://schemas.android.com/tools">
|
<resources xmlns:tools="http://schemas.android.com/tools">
|
||||||
|
<string name="add_public_reply">Add a public reply</string>
|
||||||
|
<plurals name="number_of_replies">
|
||||||
|
<item quantity="other">%d replies</item>
|
||||||
|
</plurals>
|
||||||
|
<string name="reply">Reply</string>
|
||||||
<string name="set_theme">Theme</string>
|
<string name="set_theme">Theme</string>
|
||||||
<string name="set_theme_description">Allow to change app theme</string>
|
<string name="set_theme_description">Allow to change app theme</string>
|
||||||
<string name="federation_issue">The video cannot be federated!</string>
|
<string name="federation_issue">The video cannot be federated!</string>
|
||||||
@ -161,6 +166,7 @@
|
|||||||
<string name="peertube_video_from_subscription"><![CDATA[<b>%1$s</b> published a new video: <b>%2$s</b>]]></string>
|
<string name="peertube_video_from_subscription"><![CDATA[<b>%1$s</b> published a new video: <b>%2$s</b>]]></string>
|
||||||
<string name="peertube_video_blacklist"><![CDATA[Your video <b>%1$s</b> has been blacklisted]]></string>
|
<string name="peertube_video_blacklist"><![CDATA[Your video <b>%1$s</b> has been blacklisted]]></string>
|
||||||
<string name="peertube_video_unblacklist"><![CDATA[Your video <b>%1$s</b> has been unblacklisted]]></string>
|
<string name="peertube_video_unblacklist"><![CDATA[Your video <b>%1$s</b> has been unblacklisted]]></string>
|
||||||
|
<string name="peertube_video_report_success"><![CDATA[ Your abuse <b>%1$s</b> has been accepted]]></string>
|
||||||
<string name="peertube_video_abuse"><![CDATA[New abuse report for video: <b>%1$s</b>]]></string>
|
<string name="peertube_video_abuse"><![CDATA[New abuse report for video: <b>%1$s</b>]]></string>
|
||||||
<string name="add_public_comment">Add a public comment</string>
|
<string name="add_public_comment">Add a public comment</string>
|
||||||
<string name="send_comment">Send comment</string>
|
<string name="send_comment">Send comment</string>
|
||||||
|
@ -1,5 +1,11 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<resources xmlns:tools="http://schemas.android.com/tools">
|
<resources xmlns:tools="http://schemas.android.com/tools">
|
||||||
|
<string name="add_public_reply">Add a public reply</string>
|
||||||
|
<plurals name="number_of_replies">
|
||||||
|
<item quantity="one">%d reply</item>
|
||||||
|
<item quantity="other">%d replies</item>
|
||||||
|
</plurals>
|
||||||
|
<string name="reply">Reply</string>
|
||||||
<string name="set_theme">Theme</string>
|
<string name="set_theme">Theme</string>
|
||||||
<string name="set_theme_description">Allow to change app theme</string>
|
<string name="set_theme_description">Allow to change app theme</string>
|
||||||
<string name="federation_issue">The video cannot be federated!</string>
|
<string name="federation_issue">The video cannot be federated!</string>
|
||||||
@ -161,6 +167,7 @@
|
|||||||
<string name="peertube_video_from_subscription"><![CDATA[<b>%1$s</b> publiceerde een nieuwe video: <b>%2$s</b>]]></string>
|
<string name="peertube_video_from_subscription"><![CDATA[<b>%1$s</b> publiceerde een nieuwe video: <b>%2$s</b>]]></string>
|
||||||
<string name="peertube_video_blacklist"><![CDATA[Uw video <b>%1$s</b> is op de zwarte lijst geplaatst]]></string>
|
<string name="peertube_video_blacklist"><![CDATA[Uw video <b>%1$s</b> is op de zwarte lijst geplaatst]]></string>
|
||||||
<string name="peertube_video_unblacklist"><![CDATA[Uw video <b>%1$s</b> is niet op de zwarte lijst gezet]]></string>
|
<string name="peertube_video_unblacklist"><![CDATA[Uw video <b>%1$s</b> is niet op de zwarte lijst gezet]]></string>
|
||||||
|
<string name="peertube_video_report_success"><![CDATA[ Your abuse <b>%1$s</b> has been accepted]]></string>
|
||||||
<string name="peertube_video_abuse"><![CDATA[New abuse report for video: <b>%1$s</b>]]></string>
|
<string name="peertube_video_abuse"><![CDATA[New abuse report for video: <b>%1$s</b>]]></string>
|
||||||
<string name="add_public_comment">Voeg een publieke opmerking toe</string>
|
<string name="add_public_comment">Voeg een publieke opmerking toe</string>
|
||||||
<string name="send_comment">Stuur commentaar</string>
|
<string name="send_comment">Stuur commentaar</string>
|
||||||
|
@ -1,77 +1,85 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<resources xmlns:tools="http://schemas.android.com/tools">
|
<resources xmlns:tools="http://schemas.android.com/tools">
|
||||||
<string name="set_theme">Theme</string>
|
<string name="add_public_reply">Dodaj publiczną odpowiedź</string>
|
||||||
<string name="set_theme_description">Allow to change app theme</string>
|
<plurals name="number_of_replies">
|
||||||
|
<item quantity="one">%d odpowiedź</item>
|
||||||
|
<item quantity="few">%d odpowiedzi</item>
|
||||||
|
<item quantity="many">%d odpowiedzi</item>
|
||||||
|
<item quantity="other">%d odpowiedzi</item>
|
||||||
|
</plurals>
|
||||||
|
<string name="reply">Odpowiedz</string>
|
||||||
|
<string name="set_theme">Motyw</string>
|
||||||
|
<string name="set_theme_description">Zezwól na zmianę motywu aplikacji</string>
|
||||||
<string name="federation_issue">The video cannot be federated!</string>
|
<string name="federation_issue">The video cannot be federated!</string>
|
||||||
<string name="title_home">Strona główna</string>
|
<string name="title_home">Początek</string>
|
||||||
<string name="title_local">Local</string>
|
<string name="title_local">Lokalne</string>
|
||||||
<string name="title_discover">Odkryj</string>
|
<string name="title_discover">Odkrywaj</string>
|
||||||
<string name="title_notifications">Powiadomienia</string>
|
<string name="title_notifications">Powiadomienia</string>
|
||||||
<string name="title_recently_added">Ostatnio dodany</string>
|
<string name="title_recently_added">Ostatnio dodane</string>
|
||||||
<string name="title_trending">Trendowość</string>
|
<string name="title_trending">Popularne</string>
|
||||||
<string name="title_most_liked">Najbardziej lubiany</string>
|
<string name="title_most_liked">Najbardziej lubiane</string>
|
||||||
<string name="toast_error">Oops! Wystąpił błąd!</string>
|
<string name="toast_error">Ups! Wystąpił błąd!</string>
|
||||||
<string name="title_muted">Wyciszony</string>
|
<string name="title_muted">Wyciszone</string>
|
||||||
<string name="title_channel">Kanały</string>
|
<string name="title_channel">Kanały</string>
|
||||||
<string name="do_not_list">Nie wymieniaj</string>
|
<string name="do_not_list">Nie wymieniaj</string>
|
||||||
<string name="blur">Rozmycie</string>
|
<string name="blur">Rozmycie</string>
|
||||||
<string name="display">Wyświetlacz</string>
|
<string name="display">Wyświetl</string>
|
||||||
<string name="no_opinion">Brak opinii</string>
|
<string name="no_opinion">Brak opinii</string>
|
||||||
<string name="instance_choice">Wybierz instancję</string>
|
<string name="instance_choice">Wybierz instancję</string>
|
||||||
<string name="not_valide_instance">Ten przypadek wydaje się być nieważny!</string>
|
<string name="not_valide_instance">Ta instancja nie wygląda na prawidłową!</string>
|
||||||
<string name="no_videos">Nie ma wideo!</string>
|
<string name="no_videos">Brak filmów!</string>
|
||||||
<string name="no_notifications">No notifications!</string>
|
<string name="no_notifications">Brak powiadomień!</string>
|
||||||
<string name="favicon">Favicon</string>
|
<string name="favicon">Favicon</string>
|
||||||
<string name="open_with">Otwarte z</string>
|
<string name="open_with">Otwórz przez</string>
|
||||||
<string name="action_playlist_edit">Edycja playlisty</string>
|
<string name="action_playlist_edit">Edytuj listę odtwarzania</string>
|
||||||
<string name="close">Zamknij</string>
|
<string name="close">Zamknij</string>
|
||||||
<string name="upload_video">Wczytaj</string>
|
<string name="upload_video">Prześlij</string>
|
||||||
<string name="image_preview">Podgląd obrazu</string>
|
<string name="image_preview">Podgląd obrazu</string>
|
||||||
<string name="file_to_upload">Wybierz plik do przesłania</string>
|
<string name="file_to_upload">Wybierz plik do przesłania</string>
|
||||||
<string name="channel">Kanał</string>
|
<string name="channel">Kanał</string>
|
||||||
<string name="videos">Filmy wideo</string>
|
<string name="videos">Filmy</string>
|
||||||
<string name="channels">Kanały</string>
|
<string name="channels">Kanały</string>
|
||||||
<string name="yes">Tak</string>
|
<string name="yes">Tak</string>
|
||||||
<string name="no">Nie</string>
|
<string name="no">Nie</string>
|
||||||
<string name="cancel">Anuluj</string>
|
<string name="cancel">Anuluj</string>
|
||||||
<string name="download">Pobierz</string>
|
<string name="download">Pobierz</string>
|
||||||
<string name="profile_picture">Zdjęcie profilowe</string>
|
<string name="profile_picture">Zdjęcie profilowe</string>
|
||||||
<string name="update_video">Aktualizacja wideo</string>
|
<string name="update_video">Aktualizuj film</string>
|
||||||
<string name="remove_from_playlist">Remove from playlist</string>
|
<string name="remove_from_playlist">Usuń z listy odtwarzania</string>
|
||||||
<string name="date_seconds">%d s</string>
|
<string name="date_seconds">%d s</string>
|
||||||
<string name="date_minutes">%d m</string>
|
<string name="date_minutes">%d min</string>
|
||||||
<string name="date_hours">%d h</string>
|
<string name="date_hours">%d h</string>
|
||||||
<string name="date_day">%d d</string>
|
<string name="date_day">%d dni</string>
|
||||||
<string name="number_view_video">%s widoki</string>
|
<string name="number_view_video">%s wyświetleń</string>
|
||||||
<string name="title_instance_login">Host instancji</string>
|
<string name="title_instance_login">Host instancji</string>
|
||||||
<string name="uploading">Przesyłanie, proszę czekać…</string>
|
<string name="uploading">Przesyłanie, proszę czekać…</string>
|
||||||
<string name="upload_video_success">Wideo zostało załadowane!</string>
|
<string name="upload_video_success">Film został przesłany!</string>
|
||||||
<string name="toast_cancelled">Przesyłanie anulowane!</string>
|
<string name="toast_cancelled">Przesyłanie anulowane!</string>
|
||||||
<string name="video_uploaded_action">Stuknij tutaj, aby edytować dane wideo.</string>
|
<string name="video_uploaded_action">Dotknij tutaj, aby edytować dane filmu.</string>
|
||||||
<string name="toot_select_image_error">Podczas wyboru nośnika wystąpił błąd!</string>
|
<string name="toot_select_image_error">Podczas wyboru nośnika wystąpił błąd!</string>
|
||||||
<string name="download_file">Pobierz %1$s</string>
|
<string name="download_file">Pobierz %1$s</string>
|
||||||
<string name="action_privacy">Prywatność</string>
|
<string name="action_privacy">Prywatność</string>
|
||||||
<string name="action_logout">Logout</string>
|
<string name="action_logout">Wyloguj</string>
|
||||||
<string name="login">Login</string>
|
<string name="login">Zaloguj</string>
|
||||||
<string name="password">Hasło</string>
|
<string name="password">Hasło</string>
|
||||||
<string name="email">Email</string>
|
<string name="email">E-mail</string>
|
||||||
<string name="tags">Tagi</string>
|
<string name="tags">Znaczniki</string>
|
||||||
<string name="validate">Walidacja</string>
|
<string name="validate">Potwierdź</string>
|
||||||
<string name="share_with">Dzielić się z</string>
|
<string name="share_with">Udostępnij dla</string>
|
||||||
<string name="shared_via">Współdzielone przez TubeLab</string>
|
<string name="shared_via">Udostępnione przez TubeLab</string>
|
||||||
<string name="username">Nazwa użytkownika</string>
|
<string name="username">Nazwa użytkownika</string>
|
||||||
<string name="settings">Ustawienia</string>
|
<string name="settings">Ustawienia</string>
|
||||||
<string name="logout_account_confirmation">Czy na pewno chcesz się wylogować @%1$s@%2$s?</string>
|
<string name="logout_account_confirmation">Czy na pewno chcesz wylogować @%1$s@%2$s?</string>
|
||||||
<string name="following">Obserwowane</string>
|
<string name="following">Obserwowane</string>
|
||||||
<string name="followers">Naśladowcy</string>
|
<string name="followers">Obserwujący</string>
|
||||||
<string name="client_error">Nie można dostać identyfikatora klienta!</string>
|
<string name="client_error">Błąd pobierania ID klienta!</string>
|
||||||
<string name="toast_error_loading_account">Podczas przełączania między kontami wystąpił błąd!</string>
|
<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="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="nothing_to_do">Nie można podjąć żadnych działań</string>
|
||||||
<string name="action_follow">Śledź</string>
|
<string name="action_follow">Obserwuj</string>
|
||||||
<string name="action_mute">Niemy</string>
|
<string name="action_mute">Wycisz</string>
|
||||||
<string name="search">Szukaj</string>
|
<string name="search">Szukaj</string>
|
||||||
<string name="delete">Skreślić</string>
|
<string name="delete">Usuń</string>
|
||||||
<string name="action_lists_confirm_delete">Czy na pewno chcesz na stałe usunąć tę listę?</string>
|
<string name="action_lists_confirm_delete">Czy na pewno chcesz na stałe usunąć tę listę?</string>
|
||||||
<string name="action_lists_delete">Usuń listę</string>
|
<string name="action_lists_delete">Usuń listę</string>
|
||||||
<string name="no_comments">Bądź pierwszym, który zostawi komentarz do tego filmu za pomocą prawego górnego przycisku!</string>
|
<string name="no_comments">Bądź pierwszym, który zostawi komentarz do tego filmu za pomocą prawego górnego przycisku!</string>
|
||||||
@ -86,88 +94,89 @@
|
|||||||
<string name="delete_comment">Usuń komentarz</string>
|
<string name="delete_comment">Usuń komentarz</string>
|
||||||
<string name="delete_comment_confirm">Czy na pewno usuniesz ten komentarz?</string>
|
<string name="delete_comment_confirm">Czy na pewno usuniesz ten komentarz?</string>
|
||||||
<string name="set_video_mode">Tryb dla filmów wideo</string>
|
<string name="set_video_mode">Tryb dla filmów wideo</string>
|
||||||
<string name="filter">Filter</string>
|
<string name="filter">Filtruj</string>
|
||||||
<string name="sepia_search">Sepia search</string>
|
<string name="sepia_search">Wyszukiwanie Sepia</string>
|
||||||
<string name="sepia_element_nsfw">Display sensitive content</string>
|
<string name="sepia_element_nsfw">Wyświetlaj wrażliwe treści</string>
|
||||||
<string name="sepia_element_published_date">Published date</string>
|
<string name="sepia_element_published_date">Data publikacji</string>
|
||||||
<string name="any">Any</string>
|
<string name="any">Każde</string>
|
||||||
<string name="today">Today</string>
|
<string name="today">Dzisiaj</string>
|
||||||
<string name="last_7_days">Last 7 days</string>
|
<string name="last_7_days">Ostatnie 7 dni</string>
|
||||||
<string name="last_30_days">Last 30 days</string>
|
<string name="last_30_days">Ostatnie 30 dni</string>
|
||||||
<string name="last_365_days">Last 365 days</string>
|
<string name="last_365_days">Ostatnie 365 dni</string>
|
||||||
<string name="sepia_element_duration">Duration</string>
|
<string name="sepia_element_duration">Czas trwania</string>
|
||||||
<string name="duration_short"><![CDATA[Short (<4 min)]]></string>
|
<string name="duration_short"><![CDATA[Krótkie (<4 min)]]></string>
|
||||||
<string name="duration_medium"><![CDATA[Medium (4–10 min)]]></string>
|
<string name="duration_medium"><![CDATA[Medium (4–10 min)]]></string>
|
||||||
<string name="duration_long"><![CDATA[Long (> 10 min)]]></string>
|
<string name="duration_long"><![CDATA[Długie (> 10 min)]]></string>
|
||||||
<string name="display_all_categories">Display all categories</string>
|
<string name="display_all_categories">Wyświetl wszystkie kategorie</string>
|
||||||
<string name="display_all_licenses">Display all licenses</string>
|
<string name="display_all_licenses">Wyświetl wszystkie licencje</string>
|
||||||
<string name="display_all_languages">Display all languages</string>
|
<string name="display_all_languages">Wyświetl wszystkie języki</string>
|
||||||
<string name="all_of_these_tags">All of these tags</string>
|
<string name="all_of_these_tags">Wszystkie z tych znaczników</string>
|
||||||
<string name="one_of_these_tags">One of these tags</string>
|
<string name="one_of_these_tags">Jeden z tych znaczników</string>
|
||||||
<string name="apply_filter">Apply filter</string>
|
<string name="apply_filter">Zastosuj filtr</string>
|
||||||
<string-array name="sort_by_array">
|
<string-array name="sort_by_array">
|
||||||
<item>Best match</item>
|
<item>Najlepsze dopasowanie</item>
|
||||||
<item>Most recent</item>
|
<item>Najnowsze</item>
|
||||||
<item>Least recent</item>
|
<item>Najstarsze</item>
|
||||||
</string-array>
|
</string-array>
|
||||||
<string name="sort_by">Sort by</string>
|
<string name="sort_by">Sortuj według</string>
|
||||||
<string name="sepia_search_hint">Keyword, channel, video, etc.</string>
|
<string name="sepia_search_hint">Słowo kluczowe, kanał, film itp.</string>
|
||||||
<string name="sepia_indication">Sepia Search displays videos and channels that match your search but is not the publisher, nor the owner. If you notice any problems with a video, report it to the administrators on the PeerTube website where the video is published.</string>
|
<string name="sepia_indication">Sepia Search displays videos and channels that match your search but is not the publisher, nor the owner. If you notice any problems with a video, report it to the administrators on the PeerTube website where the video is published.</string>
|
||||||
<string name="my_videos">Moje filmy</string>
|
<string name="my_videos">Moje filmy</string>
|
||||||
<string name="title">Tytuł</string>
|
<string name="title">Tytuł</string>
|
||||||
<string name="license">Licencja</string>
|
<string name="license">Licencja</string>
|
||||||
<string name="category">Kategoria</string>
|
<string name="category">Kategoria</string>
|
||||||
<string name="language">Język</string>
|
<string name="language">Język</string>
|
||||||
<string name="peertube_nsfw">Ten film zawiera dojrzałą lub wyraźną treść</string>
|
<string name="peertube_nsfw">Ten film zawiera treść dla dorosłych lub zawierającą przemoc</string>
|
||||||
<string name="peertube_enable_comments">Włączanie komentarzy wideo</string>
|
<string name="peertube_enable_comments">Zezwól na komentarze</string>
|
||||||
<string name="description">Opis</string>
|
<string name="description">Opis</string>
|
||||||
<string name="toast_peertube_video_updated">Film został zaktualizowany!</string>
|
<string name="toast_peertube_video_updated">Film został zaktualizowany!</string>
|
||||||
<string name="register_account">Zarejestruj konto</string>
|
<string name="register_account">Załóż konto</string>
|
||||||
<string name="email_address">Adres e-mail</string>
|
<string name="email_address">Adres e-mail</string>
|
||||||
<string name="preview">Premiera</string>
|
<string name="preview">Podgląd</string>
|
||||||
<string name="change_preview">Zmiana podglądu</string>
|
<string name="change_preview">Zmień podgląd</string>
|
||||||
<string name="name">Nazwa</string>
|
<string name="name">Nazwa</string>
|
||||||
<string name="display_more">Wyświetlaj więcej</string>
|
<string name="display_more">Pokaż więcej</string>
|
||||||
<string name="no_channels">Żadnych kanałów!</string>
|
<string name="no_channels">Brak kanałów!</string>
|
||||||
<string name="report_helper">Kilka wyjaśnień na temat twojego raportu…</string>
|
<string name="report_helper">Kilka wyjaśnień na temat twojego raportu…</string>
|
||||||
<string name="report_video">Wideo sprawozdawcze</string>
|
<string name="report_video">Zgłoś film</string>
|
||||||
<string name="report">Raport</string>
|
<string name="report">Zgłoś</string>
|
||||||
<string name="change_instance">Wybierz inny przypadek</string>
|
<string name="change_instance">Wybierz inną instancję</string>
|
||||||
<string name="my_history">Historia</string>
|
<string name="my_history">Historia</string>
|
||||||
<string name="edit">Edycja</string>
|
<string name="edit">Edytuj</string>
|
||||||
<string name="video_settings">Video settings</string>
|
<string name="video_settings">Ustawienia filmu</string>
|
||||||
<string name="app_interface">Interface</string>
|
<string name="app_interface">Interfejs</string>
|
||||||
<string name="set_cache_mode">Cache</string>
|
<string name="set_cache_mode">Pamięć podręczna</string>
|
||||||
<string name="set_video_cache_description">Set the cache for videos (default 100Mb)</string>
|
<string name="set_video_cache_description">Ustaw pamięć podręczną dla filmów (domyślnie 100Mb)</string>
|
||||||
<string name="set_video_quality_description">Define a default quality for videos</string>
|
<string name="set_video_quality_description">Ustaw domyślną jakość filmów</string>
|
||||||
<string name="set_quality_mode">Resolution for videos</string>
|
<string name="set_quality_mode">Rozdzielczość filmów</string>
|
||||||
<string name="video_cache_value">Video cache: %d Mb</string>
|
<string name="video_cache_value">Pamięć podręczna: %d Mb</string>
|
||||||
<string name="captions">Podpisy</string>
|
<string name="captions">Napisy</string>
|
||||||
<string name="pickup_captions">Wybierz podpisy</string>
|
<string name="pickup_captions">Wybierz napisy</string>
|
||||||
<string name="none">Brak</string>
|
<string name="none">Brak</string>
|
||||||
<string name="set_video_mode_description">Umożliwia zmianę trybu odtwarzania filmów (domyślnie, strumieniowo lub za pomocą przeglądarki).</string>
|
<string name="set_video_mode_description">Umożliwia zmianę trybu odtwarzania filmów (domyślnie, strumieniowo lub za pomocą przeglądarki).</string>
|
||||||
<string name="delete_account_comment">Delete account comments</string>
|
<string name="delete_account_comment">Usuń komentarze użytkownika</string>
|
||||||
<string name="delete_account_comment_confirm">Are you sure you want to remove all the comments of this account?</string>
|
<string name="delete_account_comment_confirm">Czy na pewno chcesz usunąć wszystkie komentarze tego użytkownika?</string>
|
||||||
<string name="delete_video">Usuń video</string>
|
<string name="delete_video">Usuń film</string>
|
||||||
<string name="delete_video_confirmation">Czy na pewno usuniesz ten film?</string>
|
<string name="delete_video_confirmation">Czy na pewno chcesz usunąć ten film?</string>
|
||||||
<string name="no_video_to_display">Brak filmów do wyświetlenia!</string>
|
<string name="no_video_to_display">Brak filmów do wyświetlenia!</string>
|
||||||
<string name="share">Podziel się</string>
|
<string name="share">Udostępnij</string>
|
||||||
<string name="peertube_comment_on_video"><![CDATA[<b>%1$s</b> skomentował twój film <b>%2$s</b>]]></string>
|
<string name="peertube_comment_on_video"><![CDATA[<b>%1$s</b> dodaje komentarz do Twojego filmu <b>%2$s</b>]]></string>
|
||||||
<string name="peertube_follow_channel"><![CDATA[<b>%1$s</b> podąża za twoim kanałem <b>%2$s</b>]]></string>
|
<string name="peertube_follow_channel"><![CDATA[<b>%1$s</b> obserwuje Twój kanał <b>%2$s</b>]]></string>
|
||||||
<string name="peertube_follow_account"><![CDATA[<b>%1$s</b> śledzi twoje konto]]></string>
|
<string name="peertube_follow_account"><![CDATA[<b>%1$s</b> obserwuje Twoje konto]]></string>
|
||||||
<string name="peertube_video_published"><![CDATA[Twój film <b>%1$s</b> został opublikowany]]></string>
|
<string name="peertube_video_published"><![CDATA[Twój film <b>%1$s</b> został opublikowany]]></string>
|
||||||
<string name="peertube_video_import_success"><![CDATA[Twój import wideo <b>%1$s</b> udał się]]></string>
|
<string name="peertube_video_import_success"><![CDATA[Twój import wideo <b>%1$s</b> udał się]]></string>
|
||||||
<string name="peertube_video_import_error"><![CDATA[Twój import wideo <b>%1$s</b> nie powiódł się]]></string>
|
<string name="peertube_video_import_error"><![CDATA[Twój import wideo <b>%1$s</b> nie powiódł się]]></string>
|
||||||
<string name="peertube_video_from_subscription"><![CDATA[<b>%1$s</b> opublikował nowe wideo: <b>%2$s</b>]]></string>
|
<string name="peertube_video_from_subscription"><![CDATA[<b>%1$s</b> publikuje nowy film: <b>%2$s</b>]]></string>
|
||||||
<string name="peertube_video_blacklist"><![CDATA[Twój film <b>%1$s</b> został umieszczony na czarnej liście]]></string>
|
<string name="peertube_video_blacklist"><![CDATA[Twój film <b>%1$s</b> został umieszczony na czarnej liście]]></string>
|
||||||
<string name="peertube_video_unblacklist"><![CDATA[Twój film <b>%1$s</b> został usunięty z czarnej listy]]></string>
|
<string name="peertube_video_unblacklist"><![CDATA[Twój film <b>%1$s</b> został usunięty z czarnej listy]]></string>
|
||||||
<string name="peertube_video_abuse"><![CDATA[New abuse report for video: <b>%1$s</b>]]></string>
|
<string name="peertube_video_report_success"><![CDATA[ Your abuse <b>%1$s</b> has been accepted]]></string>
|
||||||
<string name="add_public_comment">Dodaj komentarz publiczny</string>
|
<string name="peertube_video_abuse"><![CDATA[Nowe zgłoszenie nadużycia dla filmu: <b>%1$s</b>]]></string>
|
||||||
<string name="send_comment">Wyślij komentarz</string>
|
<string name="add_public_comment">Dodaj publiczny komentarz</string>
|
||||||
|
<string name="send_comment">Prześlij komentarz</string>
|
||||||
<string name="all">Wszystkie</string>
|
<string name="all">Wszystkie</string>
|
||||||
<!-- end languages -->
|
<!-- end languages -->
|
||||||
<string name="playlists">Playlisty</string>
|
<string name="playlists">Listy odtwarzania</string>
|
||||||
<string name="display_name">Nazwa wyświetlacza</string>
|
<string name="display_name">Wyświetlana nazwa</string>
|
||||||
<string name="action_playlist_add">Nie masz żadnej playlisty. Stuknij ikonę \"+\", aby dodać nową listę odtwarzania</string>
|
<string name="action_playlist_add">Nie masz żadnej playlisty. Stuknij ikonę \"+\", aby dodać nową listę odtwarzania</string>
|
||||||
<string name="error_display_name">Musisz podać nazwę wyświetlacza!</string>
|
<string name="error_display_name">Musisz podać nazwę wyświetlacza!</string>
|
||||||
<string name="error_channel_mandatory">Kanał jest wymagany, gdy lista odtwarzania jest publiczna.</string>
|
<string name="error_channel_mandatory">Kanał jest wymagany, gdy lista odtwarzania jest publiczna.</string>
|
||||||
@ -192,24 +201,24 @@
|
|||||||
<b>Ważny</b>Jeśli Twoja instancja wymaga weryfikacji, otrzymasz e-mail, gdy zostanie potwierdzony!
|
<b>Ważny</b>Jeśli Twoja instancja wymaga weryfikacji, otrzymasz e-mail, gdy zostanie potwierdzony!
|
||||||
</string>
|
</string>
|
||||||
<string name="account">Konto</string>
|
<string name="account">Konto</string>
|
||||||
<string name="report_account">Rachunek sprawozdawczy</string>
|
<string name="report_account">Zgłoś konto</string>
|
||||||
<string-array name="settings_video_mode">
|
<string-array name="settings_video_mode">
|
||||||
<item>Webview</item>
|
<item>Webview</item>
|
||||||
<item>Strumień bezpośredni</item>
|
<item>Webview</item>
|
||||||
<item>Direct stream</item>
|
<item>Bezpośrednio</item>
|
||||||
</string-array>
|
</string-array>
|
||||||
<string-array name="settings_theme">
|
<string-array name="settings_theme">
|
||||||
<item>Light</item>
|
<item>Jasny</item>
|
||||||
<item>Dark</item>
|
<item>Ciemny</item>
|
||||||
<item>Automatic</item>
|
<item>Automatyczny</item>
|
||||||
</string-array>
|
</string-array>
|
||||||
<string-array name="settings_video_quality">
|
<string-array name="settings_video_quality">
|
||||||
<item>High</item>
|
<item>Wysoka</item>
|
||||||
<item>Medium</item>
|
<item>Średnia</item>
|
||||||
<item>Low</item>
|
<item>Niska</item>
|
||||||
</string-array>
|
</string-array>
|
||||||
<string name="unfollow_confirm">Chcesz rozwinąć to konto?</string>
|
<string name="unfollow_confirm">Czy chcesz przestać obserwować to konto?</string>
|
||||||
<string name="title_video_peertube">Tytuł filmu wideo</string>
|
<string name="title_video_peertube">Tytuł filmu</string>
|
||||||
<string name="join_peertube">Dołącz do Peertube</string>
|
<string name="join_peertube">Dołącz do Peertube</string>
|
||||||
<string name="agreement_check_peertube">Mam co najmniej 16 lat i zgadzam się na %1$s w tym przypadku</string>
|
<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="edit_profile">Profil edycyjny</string>
|
||||||
@ -220,7 +229,7 @@
|
|||||||
<string name="bookmark_peertube_empty">Nie ma żadnych filmów w twoich ulubionych!</string>
|
<string name="bookmark_peertube_empty">Nie ma żadnych filmów w twoich ulubionych!</string>
|
||||||
<string name="delete_channel">Usuń kanał</string>
|
<string name="delete_channel">Usuń kanał</string>
|
||||||
<string name="action_channel_confirm_delete">Czy na pewno na stałe usuniesz ten kanał?</string>
|
<string name="action_channel_confirm_delete">Czy na pewno na stałe usuniesz ten kanał?</string>
|
||||||
<string name="modify_playlists">Video in playlists</string>
|
<string name="modify_playlists">Filmy w liście odtwarzania</string>
|
||||||
<string name="no_muted">Nie ma wyciszonych kont!</string>
|
<string name="no_muted">Nie ma wyciszonych kont!</string>
|
||||||
<string name="error_display_name_channel">Musisz zdefiniować nazwę i nazwę wyświetlania dla tego kanału!</string>
|
<string name="error_display_name_channel">Musisz zdefiniować nazwę i nazwę wyświetlania dla tego kanału!</string>
|
||||||
<string name="action_channel_create">Stwórz kanał</string>
|
<string name="action_channel_create">Stwórz kanał</string>
|
||||||
@ -229,7 +238,7 @@
|
|||||||
<string name="report_comment_size">Proszę podać przyczyny</string>
|
<string name="report_comment_size">Proszę podać przyczyny</string>
|
||||||
<string name="not_logged_in">Musisz być uwierzytelniony, aby przystąpić do tej akcji!</string>
|
<string name="not_logged_in">Musisz być uwierzytelniony, aby przystąpić do tej akcji!</string>
|
||||||
<string name="successful_report">Rachunek został zgłoszony!</string>
|
<string name="successful_report">Rachunek został zgłoszony!</string>
|
||||||
<string name="successful_report_comment">The comment has been reported!</string>
|
<string name="successful_report_comment">Komentarz został zgłoszony!</string>
|
||||||
<string name="successful_video_report">Film został zgłoszony!</string>
|
<string name="successful_video_report">Film został zgłoszony!</string>
|
||||||
<string name="password_length_error">Hasło musi zawierać co najmniej 6 znaków!</string>
|
<string name="password_length_error">Hasło musi zawierać co najmniej 6 znaków!</string>
|
||||||
<string name="muted_done">Rachunek został wyciszony!</string>
|
<string name="muted_done">Rachunek został wyciszony!</string>
|
||||||
|
@ -1,5 +1,11 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<resources xmlns:tools="http://schemas.android.com/tools">
|
<resources xmlns:tools="http://schemas.android.com/tools">
|
||||||
|
<string name="add_public_reply">Add a public reply</string>
|
||||||
|
<plurals name="number_of_replies">
|
||||||
|
<item quantity="one">%d reply</item>
|
||||||
|
<item quantity="other">%d replies</item>
|
||||||
|
</plurals>
|
||||||
|
<string name="reply">Reply</string>
|
||||||
<string name="set_theme">Theme</string>
|
<string name="set_theme">Theme</string>
|
||||||
<string name="set_theme_description">Allow to change app theme</string>
|
<string name="set_theme_description">Allow to change app theme</string>
|
||||||
<string name="federation_issue">The video cannot be federated!</string>
|
<string name="federation_issue">The video cannot be federated!</string>
|
||||||
@ -161,6 +167,7 @@
|
|||||||
<string name="peertube_video_from_subscription"><![CDATA[<b>%1$s</b> published a new video: <b>%2$s</b>]]></string>
|
<string name="peertube_video_from_subscription"><![CDATA[<b>%1$s</b> published a new video: <b>%2$s</b>]]></string>
|
||||||
<string name="peertube_video_blacklist"><![CDATA[Your video <b>%1$s</b> has been blacklisted]]></string>
|
<string name="peertube_video_blacklist"><![CDATA[Your video <b>%1$s</b> has been blacklisted]]></string>
|
||||||
<string name="peertube_video_unblacklist"><![CDATA[Your video <b>%1$s</b> has been unblacklisted]]></string>
|
<string name="peertube_video_unblacklist"><![CDATA[Your video <b>%1$s</b> has been unblacklisted]]></string>
|
||||||
|
<string name="peertube_video_report_success"><![CDATA[ Your abuse <b>%1$s</b> has been accepted]]></string>
|
||||||
<string name="peertube_video_abuse"><![CDATA[New abuse report for video: <b>%1$s</b>]]></string>
|
<string name="peertube_video_abuse"><![CDATA[New abuse report for video: <b>%1$s</b>]]></string>
|
||||||
<string name="add_public_comment">Add a public comment</string>
|
<string name="add_public_comment">Add a public comment</string>
|
||||||
<string name="send_comment">Send comment</string>
|
<string name="send_comment">Send comment</string>
|
||||||
|
@ -1,5 +1,12 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<resources xmlns:tools="http://schemas.android.com/tools">
|
<resources xmlns:tools="http://schemas.android.com/tools">
|
||||||
|
<string name="add_public_reply">Add a public reply</string>
|
||||||
|
<plurals name="number_of_replies">
|
||||||
|
<item quantity="one">%d reply</item>
|
||||||
|
<item quantity="few">%d replies</item>
|
||||||
|
<item quantity="other">%d replies</item>
|
||||||
|
</plurals>
|
||||||
|
<string name="reply">Reply</string>
|
||||||
<string name="set_theme">Theme</string>
|
<string name="set_theme">Theme</string>
|
||||||
<string name="set_theme_description">Allow to change app theme</string>
|
<string name="set_theme_description">Allow to change app theme</string>
|
||||||
<string name="federation_issue">The video cannot be federated!</string>
|
<string name="federation_issue">The video cannot be federated!</string>
|
||||||
@ -161,6 +168,7 @@
|
|||||||
<string name="peertube_video_from_subscription"><![CDATA[<b>%1$s</b> published a new video: <b>%2$s</b>]]></string>
|
<string name="peertube_video_from_subscription"><![CDATA[<b>%1$s</b> published a new video: <b>%2$s</b>]]></string>
|
||||||
<string name="peertube_video_blacklist"><![CDATA[Your video <b>%1$s</b> has been blacklisted]]></string>
|
<string name="peertube_video_blacklist"><![CDATA[Your video <b>%1$s</b> has been blacklisted]]></string>
|
||||||
<string name="peertube_video_unblacklist"><![CDATA[Your video <b>%1$s</b> has been unblacklisted]]></string>
|
<string name="peertube_video_unblacklist"><![CDATA[Your video <b>%1$s</b> has been unblacklisted]]></string>
|
||||||
|
<string name="peertube_video_report_success"><![CDATA[ Your abuse <b>%1$s</b> has been accepted]]></string>
|
||||||
<string name="peertube_video_abuse"><![CDATA[New abuse report for video: <b>%1$s</b>]]></string>
|
<string name="peertube_video_abuse"><![CDATA[New abuse report for video: <b>%1$s</b>]]></string>
|
||||||
<string name="add_public_comment">Add a public comment</string>
|
<string name="add_public_comment">Add a public comment</string>
|
||||||
<string name="send_comment">Send comment</string>
|
<string name="send_comment">Send comment</string>
|
||||||
|
@ -1,15 +1,23 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<resources xmlns:tools="http://schemas.android.com/tools">
|
<resources xmlns:tools="http://schemas.android.com/tools">
|
||||||
<string name="set_theme">Theme</string>
|
<string name="add_public_reply">Add a public reply</string>
|
||||||
<string name="set_theme_description">Allow to change app theme</string>
|
<plurals name="number_of_replies">
|
||||||
<string name="federation_issue">The video cannot be federated!</string>
|
<item quantity="one">%d reply</item>
|
||||||
|
<item quantity="few">%d replies</item>
|
||||||
|
<item quantity="many">%d replies</item>
|
||||||
|
<item quantity="other">%d replies</item>
|
||||||
|
</plurals>
|
||||||
|
<string name="reply">Reply</string>
|
||||||
|
<string name="set_theme">Тема</string>
|
||||||
|
<string name="set_theme_description">Позволяет менять тему приложения</string>
|
||||||
|
<string name="federation_issue">Видео не может быть объединено!</string>
|
||||||
<string name="title_home">Главная</string>
|
<string name="title_home">Главная</string>
|
||||||
<string name="title_local">Локальные</string>
|
<string name="title_local">Локальные</string>
|
||||||
<string name="title_discover">Подборка</string>
|
<string name="title_discover">Подборка</string>
|
||||||
<string name="title_notifications">Уведомления</string>
|
<string name="title_notifications">Уведомления</string>
|
||||||
<string name="title_recently_added">По добавлению</string>
|
<string name="title_recently_added">Свежие</string>
|
||||||
<string name="title_trending">Популярные</string>
|
<string name="title_trending">Актуальное</string>
|
||||||
<string name="title_most_liked">Много лайков</string>
|
<string name="title_most_liked">Популярные</string>
|
||||||
<string name="toast_error">Упс! Произошла ошибка!</string>
|
<string name="toast_error">Упс! Произошла ошибка!</string>
|
||||||
<string name="title_muted">Беззвучный</string>
|
<string name="title_muted">Беззвучный</string>
|
||||||
<string name="title_channel">Каналы</string>
|
<string name="title_channel">Каналы</string>
|
||||||
@ -138,16 +146,16 @@
|
|||||||
<string name="video_settings">Настройки видео</string>
|
<string name="video_settings">Настройки видео</string>
|
||||||
<string name="app_interface">Интерфейс</string>
|
<string name="app_interface">Интерфейс</string>
|
||||||
<string name="set_cache_mode">Кэш</string>
|
<string name="set_cache_mode">Кэш</string>
|
||||||
<string name="set_video_cache_description">Определите кеш для видео (по умолчанию 100 Мб)</string>
|
<string name="set_video_cache_description">Определите кэш для видео (по умолчанию 100 Мб)</string>
|
||||||
<string name="set_video_quality_description">Определить качество видео по умолчанию</string>
|
<string name="set_video_quality_description">Определить качество видео по умолчанию</string>
|
||||||
<string name="set_quality_mode">Разрешение для видео</string>
|
<string name="set_quality_mode">Разрешение для видео</string>
|
||||||
<string name="video_cache_value">Видео кэш: %d Мб</string>
|
<string name="video_cache_value">Видео кэш: %d Мб</string>
|
||||||
<string name="captions">Субтитры</string>
|
<string name="captions">Субтитры</string>
|
||||||
<string name="pickup_captions">Выбрать субтитры</string>
|
<string name="pickup_captions">Выбрать субтитры</string>
|
||||||
<string name="none">Ничто</string>
|
<string name="none">Ничто</string>
|
||||||
<string name="set_video_mode_description">Позволяет изменить режим воспроизведения видео (по умолчанию потоковый или через браузер).</string>
|
<string name="set_video_mode_description">Позволяет изменить режим воспроизведения видео (по умолчанию, потоковый или через браузер).</string>
|
||||||
<string name="delete_account_comment">Delete account comments</string>
|
<string name="delete_account_comment">Удалить комментарии аккаунта</string>
|
||||||
<string name="delete_account_comment_confirm">Are you sure you want to remove all the comments of this account?</string>
|
<string name="delete_account_comment_confirm">Вы действительно хотите удалить все комментарии этого аккаунта?</string>
|
||||||
<string name="delete_video">Удалить видео</string>
|
<string name="delete_video">Удалить видео</string>
|
||||||
<string name="delete_video_confirmation">Вы уверены, что хотите удалить это видео?</string>
|
<string name="delete_video_confirmation">Вы уверены, что хотите удалить это видео?</string>
|
||||||
<string name="no_video_to_display">Нет видео для отображения!</string>
|
<string name="no_video_to_display">Нет видео для отображения!</string>
|
||||||
@ -161,6 +169,7 @@
|
|||||||
<string name="peertube_video_from_subscription"><![CDATA[<b>%1$s</b> опубликовал новое видео: <b>%2$s</b>]]></string>
|
<string name="peertube_video_from_subscription"><![CDATA[<b>%1$s</b> опубликовал новое видео: <b>%2$s</b>]]></string>
|
||||||
<string name="peertube_video_blacklist"><![CDATA[Ваше видео <b>%1$s</b> занесено в чёрный список]]></string>
|
<string name="peertube_video_blacklist"><![CDATA[Ваше видео <b>%1$s</b> занесено в чёрный список]]></string>
|
||||||
<string name="peertube_video_unblacklist"><![CDATA[Ваше видео <b>%1$s</b> удалено из чёрного списка]]></string>
|
<string name="peertube_video_unblacklist"><![CDATA[Ваше видео <b>%1$s</b> удалено из чёрного списка]]></string>
|
||||||
|
<string name="peertube_video_report_success"><![CDATA[ Your abuse <b>%1$s</b> has been accepted]]></string>
|
||||||
<string name="peertube_video_abuse"><![CDATA[Новый отчёт о нарушении для видео: <b>%1$s</b>]]></string>
|
<string name="peertube_video_abuse"><![CDATA[Новый отчёт о нарушении для видео: <b>%1$s</b>]]></string>
|
||||||
<string name="add_public_comment">Добавить публичный комментарий</string>
|
<string name="add_public_comment">Добавить публичный комментарий</string>
|
||||||
<string name="send_comment">Оставить комментарий</string>
|
<string name="send_comment">Оставить комментарий</string>
|
||||||
@ -194,14 +203,14 @@
|
|||||||
<string name="account">Аккаунт</string>
|
<string name="account">Аккаунт</string>
|
||||||
<string name="report_account">Пожаловаться на аккаунт</string>
|
<string name="report_account">Пожаловаться на аккаунт</string>
|
||||||
<string-array name="settings_video_mode">
|
<string-array name="settings_video_mode">
|
||||||
|
<item>По умолчанию</item>
|
||||||
<item>Веб-просмотр</item>
|
<item>Веб-просмотр</item>
|
||||||
<item>Прямой поток</item>
|
<item>Прямой поток</item>
|
||||||
<item>Прямой поток</item>
|
|
||||||
</string-array>
|
</string-array>
|
||||||
<string-array name="settings_theme">
|
<string-array name="settings_theme">
|
||||||
<item>Light</item>
|
<item>Светлая</item>
|
||||||
<item>Dark</item>
|
<item>Тёмная</item>
|
||||||
<item>Automatic</item>
|
<item>Авто</item>
|
||||||
</string-array>
|
</string-array>
|
||||||
<string-array name="settings_video_quality">
|
<string-array name="settings_video_quality">
|
||||||
<item>Высокое</item>
|
<item>Высокое</item>
|
||||||
|
@ -1,5 +1,11 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<resources xmlns:tools="http://schemas.android.com/tools">
|
<resources xmlns:tools="http://schemas.android.com/tools">
|
||||||
|
<string name="add_public_reply">Add a public reply</string>
|
||||||
|
<plurals name="number_of_replies">
|
||||||
|
<item quantity="one">%d reply</item>
|
||||||
|
<item quantity="other">%d replies</item>
|
||||||
|
</plurals>
|
||||||
|
<string name="reply">Reply</string>
|
||||||
<string name="set_theme">Theme</string>
|
<string name="set_theme">Theme</string>
|
||||||
<string name="set_theme_description">Allow to change app theme</string>
|
<string name="set_theme_description">Allow to change app theme</string>
|
||||||
<string name="federation_issue">The video cannot be federated!</string>
|
<string name="federation_issue">The video cannot be federated!</string>
|
||||||
@ -161,6 +167,7 @@
|
|||||||
<string name="peertube_video_from_subscription"><![CDATA[<b>%1$s</b> published a new video: <b>%2$s</b>]]></string>
|
<string name="peertube_video_from_subscription"><![CDATA[<b>%1$s</b> published a new video: <b>%2$s</b>]]></string>
|
||||||
<string name="peertube_video_blacklist"><![CDATA[Your video <b>%1$s</b> has been blacklisted]]></string>
|
<string name="peertube_video_blacklist"><![CDATA[Your video <b>%1$s</b> has been blacklisted]]></string>
|
||||||
<string name="peertube_video_unblacklist"><![CDATA[Your video <b>%1$s</b> has been unblacklisted]]></string>
|
<string name="peertube_video_unblacklist"><![CDATA[Your video <b>%1$s</b> has been unblacklisted]]></string>
|
||||||
|
<string name="peertube_video_report_success"><![CDATA[ Your abuse <b>%1$s</b> has been accepted]]></string>
|
||||||
<string name="peertube_video_abuse"><![CDATA[New abuse report for video: <b>%1$s</b>]]></string>
|
<string name="peertube_video_abuse"><![CDATA[New abuse report for video: <b>%1$s</b>]]></string>
|
||||||
<string name="add_public_comment">Add a public comment</string>
|
<string name="add_public_comment">Add a public comment</string>
|
||||||
<string name="send_comment">Send comment</string>
|
<string name="send_comment">Send comment</string>
|
||||||
|
@ -1,5 +1,10 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<resources xmlns:tools="http://schemas.android.com/tools">
|
<resources xmlns:tools="http://schemas.android.com/tools">
|
||||||
|
<string name="add_public_reply">Add a public reply</string>
|
||||||
|
<plurals name="number_of_replies">
|
||||||
|
<item quantity="other">%d replies</item>
|
||||||
|
</plurals>
|
||||||
|
<string name="reply">Reply</string>
|
||||||
<string name="set_theme">Theme</string>
|
<string name="set_theme">Theme</string>
|
||||||
<string name="set_theme_description">Allow to change app theme</string>
|
<string name="set_theme_description">Allow to change app theme</string>
|
||||||
<string name="federation_issue">The video cannot be federated!</string>
|
<string name="federation_issue">The video cannot be federated!</string>
|
||||||
@ -161,6 +166,7 @@
|
|||||||
<string name="peertube_video_from_subscription"><![CDATA[<b>%1$s</b> published a new video: <b>%2$s</b>]]></string>
|
<string name="peertube_video_from_subscription"><![CDATA[<b>%1$s</b> published a new video: <b>%2$s</b>]]></string>
|
||||||
<string name="peertube_video_blacklist"><![CDATA[Your video <b>%1$s</b> has been blacklisted]]></string>
|
<string name="peertube_video_blacklist"><![CDATA[Your video <b>%1$s</b> has been blacklisted]]></string>
|
||||||
<string name="peertube_video_unblacklist"><![CDATA[Your video <b>%1$s</b> has been unblacklisted]]></string>
|
<string name="peertube_video_unblacklist"><![CDATA[Your video <b>%1$s</b> has been unblacklisted]]></string>
|
||||||
|
<string name="peertube_video_report_success"><![CDATA[ Your abuse <b>%1$s</b> has been accepted]]></string>
|
||||||
<string name="peertube_video_abuse"><![CDATA[New abuse report for video: <b>%1$s</b>]]></string>
|
<string name="peertube_video_abuse"><![CDATA[New abuse report for video: <b>%1$s</b>]]></string>
|
||||||
<string name="add_public_comment">Add a public comment</string>
|
<string name="add_public_comment">Add a public comment</string>
|
||||||
<string name="send_comment">Send comment</string>
|
<string name="send_comment">Send comment</string>
|
||||||
|
@ -1,5 +1,10 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<resources xmlns:tools="http://schemas.android.com/tools">
|
<resources xmlns:tools="http://schemas.android.com/tools">
|
||||||
|
<string name="add_public_reply">Add a public reply</string>
|
||||||
|
<plurals name="number_of_replies">
|
||||||
|
<item quantity="other">%d replies</item>
|
||||||
|
</plurals>
|
||||||
|
<string name="reply">Reply</string>
|
||||||
<string name="set_theme">Theme</string>
|
<string name="set_theme">Theme</string>
|
||||||
<string name="set_theme_description">Allow to change app theme</string>
|
<string name="set_theme_description">Allow to change app theme</string>
|
||||||
<string name="federation_issue">The video cannot be federated!</string>
|
<string name="federation_issue">The video cannot be federated!</string>
|
||||||
@ -161,6 +166,7 @@
|
|||||||
<string name="peertube_video_from_subscription"><![CDATA[<b>%1$s</b> published a new video: <b>%2$s</b>]]></string>
|
<string name="peertube_video_from_subscription"><![CDATA[<b>%1$s</b> published a new video: <b>%2$s</b>]]></string>
|
||||||
<string name="peertube_video_blacklist"><![CDATA[Your video <b>%1$s</b> has been blacklisted]]></string>
|
<string name="peertube_video_blacklist"><![CDATA[Your video <b>%1$s</b> has been blacklisted]]></string>
|
||||||
<string name="peertube_video_unblacklist"><![CDATA[Your video <b>%1$s</b> has been unblacklisted]]></string>
|
<string name="peertube_video_unblacklist"><![CDATA[Your video <b>%1$s</b> has been unblacklisted]]></string>
|
||||||
|
<string name="peertube_video_report_success"><![CDATA[ Your abuse <b>%1$s</b> has been accepted]]></string>
|
||||||
<string name="peertube_video_abuse"><![CDATA[New abuse report for video: <b>%1$s</b>]]></string>
|
<string name="peertube_video_abuse"><![CDATA[New abuse report for video: <b>%1$s</b>]]></string>
|
||||||
<string name="add_public_comment">Add a public comment</string>
|
<string name="add_public_comment">Add a public comment</string>
|
||||||
<string name="send_comment">Send comment</string>
|
<string name="send_comment">Send comment</string>
|
||||||
|
@ -7,7 +7,13 @@
|
|||||||
<string name="set_video_cache_choice" translatable="false">set_video_cache_choice</string>
|
<string name="set_video_cache_choice" translatable="false">set_video_cache_choice</string>
|
||||||
<string name="set_theme_choice" translatable="false">set_theme_choice</string>
|
<string name="set_theme_choice" translatable="false">set_theme_choice</string>
|
||||||
|
|
||||||
|
<string name="add_public_reply">Add a public reply</string>
|
||||||
|
|
||||||
|
<plurals name="number_of_replies">
|
||||||
|
<item quantity="one">%d reply</item>
|
||||||
|
<item quantity="other">%d replies</item>
|
||||||
|
</plurals>
|
||||||
|
<string name="reply">Reply</string>
|
||||||
<string name="set_theme">Theme</string>
|
<string name="set_theme">Theme</string>
|
||||||
<string name="set_theme_description">Allow to change app theme</string>
|
<string name="set_theme_description">Allow to change app theme</string>
|
||||||
<string name="federation_issue">The video cannot be federated!</string>
|
<string name="federation_issue">The video cannot be federated!</string>
|
||||||
@ -210,6 +216,7 @@
|
|||||||
<string name="peertube_video_from_subscription"><![CDATA[<b>%1$s</b> published a new video: <b>%2$s</b>]]></string>
|
<string name="peertube_video_from_subscription"><![CDATA[<b>%1$s</b> published a new video: <b>%2$s</b>]]></string>
|
||||||
<string name="peertube_video_blacklist"><![CDATA[Your video <b>%1$s</b> has been blacklisted]]></string>
|
<string name="peertube_video_blacklist"><![CDATA[Your video <b>%1$s</b> has been blacklisted]]></string>
|
||||||
<string name="peertube_video_unblacklist"><![CDATA[Your video <b>%1$s</b> has been unblacklisted]]></string>
|
<string name="peertube_video_unblacklist"><![CDATA[Your video <b>%1$s</b> has been unblacklisted]]></string>
|
||||||
|
<string name="peertube_video_report_success"><![CDATA[ Your abuse <b>%1$s</b> has been accepted]]></string>
|
||||||
<string name="peertube_video_abuse"><![CDATA[New abuse report for video: <b>%1$s</b>]]></string>
|
<string name="peertube_video_abuse"><![CDATA[New abuse report for video: <b>%1$s</b>]]></string>
|
||||||
<string name="add_public_comment">Add a public comment</string>
|
<string name="add_public_comment">Add a public comment</string>
|
||||||
<string name="send_comment">Send comment</string>
|
<string name="send_comment">Send comment</string>
|
||||||
|
@ -58,6 +58,11 @@
|
|||||||
android:configChanges="orientation|screenSize"
|
android:configChanges="orientation|screenSize"
|
||||||
android:label="@string/app_name"
|
android:label="@string/app_name"
|
||||||
android:windowSoftInputMode="stateAlwaysHidden" />
|
android:windowSoftInputMode="stateAlwaysHidden" />
|
||||||
|
<activity
|
||||||
|
android:name=".ShowAccountActivity"
|
||||||
|
android:configChanges="orientation|screenSize"
|
||||||
|
android:label="@string/app_name"
|
||||||
|
android:windowSoftInputMode="stateAlwaysHidden" />
|
||||||
<activity
|
<activity
|
||||||
android:name=".AccountActivity"
|
android:name=".AccountActivity"
|
||||||
android:configChanges="orientation|screenSize"
|
android:configChanges="orientation|screenSize"
|
||||||
|
2684
app/src/main/assets/emoji.csv
Normal file
2684
app/src/main/assets/emoji.csv
Normal file
File diff suppressed because it is too large
Load Diff
@ -74,31 +74,26 @@ public class MainActivity extends AppCompatActivity {
|
|||||||
private DisplayVideosFragment recentFragment, locaFragment, trendingFragment, subscriptionFragment, mostLikedFragment;
|
private DisplayVideosFragment recentFragment, locaFragment, trendingFragment, subscriptionFragment, mostLikedFragment;
|
||||||
private DisplayOverviewFragment overviewFragment;
|
private DisplayOverviewFragment overviewFragment;
|
||||||
|
|
||||||
private BottomNavigationView.OnNavigationItemSelectedListener mOnNavigationItemSelectedListener
|
private final BottomNavigationView.OnNavigationItemSelectedListener mOnNavigationItemSelectedListener
|
||||||
= item -> {
|
= item -> {
|
||||||
DisplayVideosFragment displayVideosFragment = null;
|
DisplayVideosFragment displayVideosFragment = null;
|
||||||
switch (item.getItemId()) {
|
int itemId = item.getItemId();
|
||||||
case R.id.navigation_subscription:
|
if (itemId == R.id.navigation_subscription) {
|
||||||
displayVideosFragment = subscriptionFragment;
|
displayVideosFragment = subscriptionFragment;
|
||||||
setTitle(R.string.subscriptions);
|
setTitle(R.string.subscriptions);
|
||||||
break;
|
} else if (itemId == R.id.navigation_trending) {
|
||||||
case R.id.navigation_trending:
|
|
||||||
setTitle(R.string.title_trending);
|
setTitle(R.string.title_trending);
|
||||||
displayVideosFragment = trendingFragment;
|
displayVideosFragment = trendingFragment;
|
||||||
break;
|
} else if (itemId == R.id.navigation_most_liked) {
|
||||||
case R.id.navigation_most_liked:
|
|
||||||
setTitle(R.string.title_most_liked);
|
setTitle(R.string.title_most_liked);
|
||||||
displayVideosFragment = mostLikedFragment;
|
displayVideosFragment = mostLikedFragment;
|
||||||
break;
|
} else if (itemId == R.id.navigation_recently_added) {
|
||||||
case R.id.navigation_recently_added:
|
|
||||||
setTitle(R.string.title_recently_added);
|
setTitle(R.string.title_recently_added);
|
||||||
displayVideosFragment = recentFragment;
|
displayVideosFragment = recentFragment;
|
||||||
break;
|
} else if (itemId == R.id.navigation_local) {
|
||||||
case R.id.navigation_local:
|
|
||||||
setTitle(R.string.title_local);
|
setTitle(R.string.title_local);
|
||||||
displayVideosFragment = locaFragment;
|
displayVideosFragment = locaFragment;
|
||||||
break;
|
} else if (itemId == R.id.navigation_discover) {
|
||||||
case R.id.navigation_discover:
|
|
||||||
setTitle(R.string.title_discover);
|
setTitle(R.string.title_discover);
|
||||||
fm.beginTransaction().hide(active).show(overviewFragment).commit();
|
fm.beginTransaction().hide(active).show(overviewFragment).commit();
|
||||||
active = overviewFragment;
|
active = overviewFragment;
|
||||||
|
@ -18,7 +18,10 @@ import android.Manifest;
|
|||||||
import android.annotation.SuppressLint;
|
import android.annotation.SuppressLint;
|
||||||
import android.app.Activity;
|
import android.app.Activity;
|
||||||
import android.app.Dialog;
|
import android.app.Dialog;
|
||||||
|
import android.content.BroadcastReceiver;
|
||||||
|
import android.content.Context;
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
|
import android.content.IntentFilter;
|
||||||
import android.content.SharedPreferences;
|
import android.content.SharedPreferences;
|
||||||
import android.content.pm.ActivityInfo;
|
import android.content.pm.ActivityInfo;
|
||||||
import android.content.pm.PackageManager;
|
import android.content.pm.PackageManager;
|
||||||
@ -32,20 +35,20 @@ import android.os.Bundle;
|
|||||||
import android.os.Handler;
|
import android.os.Handler;
|
||||||
import android.support.v4.media.session.MediaSessionCompat;
|
import android.support.v4.media.session.MediaSessionCompat;
|
||||||
import android.text.Html;
|
import android.text.Html;
|
||||||
|
import android.text.Spanned;
|
||||||
import android.view.LayoutInflater;
|
import android.view.LayoutInflater;
|
||||||
import android.view.MenuItem;
|
import android.view.MenuItem;
|
||||||
import android.view.MotionEvent;
|
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.view.ViewGroup;
|
import android.view.ViewGroup;
|
||||||
import android.view.WindowManager;
|
import android.view.WindowManager;
|
||||||
|
import android.view.animation.Animation;
|
||||||
|
import android.view.animation.TranslateAnimation;
|
||||||
import android.view.inputmethod.InputMethodManager;
|
import android.view.inputmethod.InputMethodManager;
|
||||||
import android.widget.ArrayAdapter;
|
import android.widget.ArrayAdapter;
|
||||||
import android.widget.Button;
|
|
||||||
import android.widget.EditText;
|
import android.widget.EditText;
|
||||||
import android.widget.FrameLayout;
|
import android.widget.FrameLayout;
|
||||||
import android.widget.ImageView;
|
import android.widget.ImageView;
|
||||||
import android.widget.LinearLayout;
|
import android.widget.LinearLayout;
|
||||||
import android.widget.RelativeLayout;
|
|
||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
import android.widget.Toast;
|
import android.widget.Toast;
|
||||||
|
|
||||||
@ -53,12 +56,10 @@ import androidx.annotation.NonNull;
|
|||||||
import androidx.annotation.RequiresApi;
|
import androidx.annotation.RequiresApi;
|
||||||
import androidx.appcompat.app.AlertDialog;
|
import androidx.appcompat.app.AlertDialog;
|
||||||
import androidx.appcompat.app.AppCompatActivity;
|
import androidx.appcompat.app.AppCompatActivity;
|
||||||
import androidx.appcompat.widget.AppCompatImageView;
|
|
||||||
import androidx.appcompat.widget.PopupMenu;
|
import androidx.appcompat.widget.PopupMenu;
|
||||||
import androidx.core.app.ActivityCompat;
|
import androidx.core.app.ActivityCompat;
|
||||||
import androidx.core.content.ContextCompat;
|
import androidx.core.content.ContextCompat;
|
||||||
import androidx.core.graphics.drawable.DrawableCompat;
|
import androidx.core.graphics.drawable.DrawableCompat;
|
||||||
import androidx.core.widget.NestedScrollView;
|
|
||||||
import androidx.lifecycle.ViewModelProvider;
|
import androidx.lifecycle.ViewModelProvider;
|
||||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||||
import androidx.recyclerview.widget.RecyclerView;
|
import androidx.recyclerview.widget.RecyclerView;
|
||||||
@ -78,7 +79,6 @@ import com.google.android.exoplayer2.trackselection.DefaultTrackSelector;
|
|||||||
import com.google.android.exoplayer2.trackselection.TrackSelector;
|
import com.google.android.exoplayer2.trackselection.TrackSelector;
|
||||||
import com.google.android.exoplayer2.ui.AspectRatioFrameLayout;
|
import com.google.android.exoplayer2.ui.AspectRatioFrameLayout;
|
||||||
import com.google.android.exoplayer2.ui.PlayerControlView;
|
import com.google.android.exoplayer2.ui.PlayerControlView;
|
||||||
import com.google.android.exoplayer2.ui.PlayerView;
|
|
||||||
import com.google.android.exoplayer2.upstream.DataSource;
|
import com.google.android.exoplayer2.upstream.DataSource;
|
||||||
import com.google.android.exoplayer2.upstream.DefaultDataSourceFactory;
|
import com.google.android.exoplayer2.upstream.DefaultDataSourceFactory;
|
||||||
import com.google.android.exoplayer2.upstream.DefaultHttpDataSourceFactory;
|
import com.google.android.exoplayer2.upstream.DefaultHttpDataSourceFactory;
|
||||||
@ -97,6 +97,7 @@ import app.fedilab.fedilabtube.client.APIResponse;
|
|||||||
import app.fedilab.fedilabtube.client.RetrofitPeertubeAPI;
|
import app.fedilab.fedilabtube.client.RetrofitPeertubeAPI;
|
||||||
import app.fedilab.fedilabtube.client.data.AccountData.Account;
|
import app.fedilab.fedilabtube.client.data.AccountData.Account;
|
||||||
import app.fedilab.fedilabtube.client.data.CaptionData.Caption;
|
import app.fedilab.fedilabtube.client.data.CaptionData.Caption;
|
||||||
|
import app.fedilab.fedilabtube.client.data.CommentData;
|
||||||
import app.fedilab.fedilabtube.client.data.CommentData.Comment;
|
import app.fedilab.fedilabtube.client.data.CommentData.Comment;
|
||||||
import app.fedilab.fedilabtube.client.data.PlaylistData;
|
import app.fedilab.fedilabtube.client.data.PlaylistData;
|
||||||
import app.fedilab.fedilabtube.client.data.VideoData;
|
import app.fedilab.fedilabtube.client.data.VideoData;
|
||||||
@ -104,6 +105,7 @@ import app.fedilab.fedilabtube.client.entities.File;
|
|||||||
import app.fedilab.fedilabtube.client.entities.ItemStr;
|
import app.fedilab.fedilabtube.client.entities.ItemStr;
|
||||||
import app.fedilab.fedilabtube.client.entities.PlaylistExist;
|
import app.fedilab.fedilabtube.client.entities.PlaylistExist;
|
||||||
import app.fedilab.fedilabtube.client.entities.Report;
|
import app.fedilab.fedilabtube.client.entities.Report;
|
||||||
|
import app.fedilab.fedilabtube.databinding.ActivityPeertubeBinding;
|
||||||
import app.fedilab.fedilabtube.drawer.CommentListAdapter;
|
import app.fedilab.fedilabtube.drawer.CommentListAdapter;
|
||||||
import app.fedilab.fedilabtube.helper.CacheDataSourceFactory;
|
import app.fedilab.fedilabtube.helper.CacheDataSourceFactory;
|
||||||
import app.fedilab.fedilabtube.helper.FullScreenMediaController;
|
import app.fedilab.fedilabtube.helper.FullScreenMediaController;
|
||||||
@ -123,6 +125,7 @@ import es.dmoral.toasty.Toasty;
|
|||||||
|
|
||||||
import static app.fedilab.fedilabtube.client.RetrofitPeertubeAPI.ActionType.ADD_COMMENT;
|
import static app.fedilab.fedilabtube.client.RetrofitPeertubeAPI.ActionType.ADD_COMMENT;
|
||||||
import static app.fedilab.fedilabtube.client.RetrofitPeertubeAPI.ActionType.RATEVIDEO;
|
import static app.fedilab.fedilabtube.client.RetrofitPeertubeAPI.ActionType.RATEVIDEO;
|
||||||
|
import static app.fedilab.fedilabtube.client.RetrofitPeertubeAPI.ActionType.REPLY;
|
||||||
import static app.fedilab.fedilabtube.client.RetrofitPeertubeAPI.ActionType.REPORT_ACCOUNT;
|
import static app.fedilab.fedilabtube.client.RetrofitPeertubeAPI.ActionType.REPORT_ACCOUNT;
|
||||||
import static app.fedilab.fedilabtube.client.RetrofitPeertubeAPI.ActionType.REPORT_VIDEO;
|
import static app.fedilab.fedilabtube.client.RetrofitPeertubeAPI.ActionType.REPORT_VIDEO;
|
||||||
import static app.fedilab.fedilabtube.helper.Helper.getAttColor;
|
import static app.fedilab.fedilabtube.helper.Helper.getAttColor;
|
||||||
@ -135,33 +138,26 @@ public class PeertubeActivity extends AppCompatActivity implements CommentListAd
|
|||||||
public static String video_id;
|
public static String video_id;
|
||||||
private String peertubeInstance, videoUuid;
|
private String peertubeInstance, videoUuid;
|
||||||
private FullScreenMediaController.fullscreen fullscreen;
|
private FullScreenMediaController.fullscreen fullscreen;
|
||||||
private RelativeLayout loader;
|
private ImageView fullScreenIcon;
|
||||||
private TextView peertube_view_count, peertube_playlist, peertube_bookmark, peertube_like_count, peertube_dislike_count, peertube_description, peertube_title, more_actions;
|
|
||||||
private NestedScrollView peertube_information_container;
|
|
||||||
private VideoData.Video peertube;
|
|
||||||
private PlayerView playerView;
|
|
||||||
private SimpleExoPlayer player;
|
private SimpleExoPlayer player;
|
||||||
private boolean fullScreenMode;
|
private boolean fullScreenMode;
|
||||||
private Dialog fullScreenDialog;
|
private Dialog fullScreenDialog;
|
||||||
private AppCompatImageView fullScreenIcon;
|
private VideoData.Video peertube;
|
||||||
private TextView resolution;
|
|
||||||
private int mode;
|
private int mode;
|
||||||
private LinearLayout write_comment_container;
|
|
||||||
private ImageView send;
|
|
||||||
private TextView add_comment_read;
|
|
||||||
private EditText add_comment_write;
|
|
||||||
private Map<String, List<PlaylistExist>> playlists;
|
private Map<String, List<PlaylistExist>> playlists;
|
||||||
private boolean playInMinimized;
|
private boolean playInMinimized;
|
||||||
private boolean onStopCalled;
|
private boolean onStopCalled;
|
||||||
private List<Caption> captions;
|
private List<Caption> captions;
|
||||||
private TextView no_action_text;
|
|
||||||
private String max_id;
|
private String max_id;
|
||||||
private RecyclerView lv_comments;
|
|
||||||
private boolean flag_loading;
|
private boolean flag_loading;
|
||||||
private boolean isMyVideo;
|
private boolean isMyVideo;
|
||||||
private List<Comment> comments;
|
private List<Comment> comments;
|
||||||
private CommentListAdapter commentListAdapter;
|
private CommentListAdapter commentListAdapter;
|
||||||
|
private CommentListAdapter commentReplyListAdapter;
|
||||||
private boolean sepiaSearch;
|
private boolean sepiaSearch;
|
||||||
|
private ActivityPeertubeBinding binding;
|
||||||
|
private List<Comment> commentsThread;
|
||||||
|
private BroadcastReceiver mPowerKeyReceiver = null;
|
||||||
|
|
||||||
public static void hideKeyboard(Activity activity) {
|
public static void hideKeyboard(Activity activity) {
|
||||||
if (activity != null && activity.getWindow() != null) {
|
if (activity != null && activity.getWindow() != null) {
|
||||||
@ -171,51 +167,39 @@ public class PeertubeActivity extends AppCompatActivity implements CommentListAd
|
|||||||
imm.hideSoftInputFromWindow(activity.getWindow().getDecorView().getWindowToken(), 0);
|
imm.hideSoftInputFromWindow(activity.getWindow().getDecorView().getWindowToken(), 0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
private boolean isPlayInMinimized;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onCreate(Bundle savedInstanceState) {
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
setContentView(R.layout.activity_peertube);
|
|
||||||
|
|
||||||
peertube_view_count = findViewById(R.id.peertube_view_count);
|
|
||||||
peertube_bookmark = findViewById(R.id.peertube_bookmark);
|
|
||||||
peertube_like_count = findViewById(R.id.peertube_like_count);
|
|
||||||
peertube_dislike_count = findViewById(R.id.peertube_dislike_count);
|
|
||||||
more_actions = findViewById(R.id.more_actions);
|
|
||||||
|
|
||||||
peertube_description = findViewById(R.id.peertube_description);
|
binding = ActivityPeertubeBinding.inflate(getLayoutInflater());
|
||||||
peertube_title = findViewById(R.id.peertube_title);
|
View view = binding.getRoot();
|
||||||
peertube_information_container = findViewById(R.id.peertube_information_container);
|
setContentView(view);
|
||||||
add_comment_read = findViewById(R.id.add_comment_read);
|
|
||||||
add_comment_write = findViewById(R.id.add_comment_write);
|
|
||||||
peertube_playlist = findViewById(R.id.peertube_playlist);
|
|
||||||
send = findViewById(R.id.send);
|
|
||||||
CustomWebview webview_video = findViewById(R.id.webview_video);
|
|
||||||
playerView = findViewById(R.id.media_video);
|
|
||||||
write_comment_container = findViewById(R.id.write_comment_container);
|
|
||||||
|
|
||||||
max_id = "0";
|
max_id = "0";
|
||||||
loader = findViewById(R.id.loader);
|
|
||||||
ImageView my_pp = findViewById(R.id.my_pp);
|
|
||||||
SQLiteDatabase db = Sqlite.getInstance(getApplicationContext(), Sqlite.DB_NAME, null, Sqlite.DB_VERSION).open();
|
SQLiteDatabase db = Sqlite.getInstance(getApplicationContext(), Sqlite.DB_NAME, null, Sqlite.DB_VERSION).open();
|
||||||
SharedPreferences sharedpreferences = getSharedPreferences(Helper.APP_PREFS, MODE_PRIVATE);
|
SharedPreferences sharedpreferences = getSharedPreferences(Helper.APP_PREFS, MODE_PRIVATE);
|
||||||
String token = sharedpreferences.getString(Helper.PREF_KEY_OAUTH_TOKEN, null);
|
String token = sharedpreferences.getString(Helper.PREF_KEY_OAUTH_TOKEN, null);
|
||||||
if (Helper.isLoggedIn(PeertubeActivity.this) && !sepiaSearch) {
|
if (Helper.isLoggedIn(PeertubeActivity.this) && !sepiaSearch) {
|
||||||
Account account = new AccountDAO(PeertubeActivity.this, db).getAccountByToken(token);
|
Account account = new AccountDAO(PeertubeActivity.this, db).getAccountByToken(token);
|
||||||
Helper.loadGiF(PeertubeActivity.this, account.getAvatar() != null ? account.getAvatar().getPath() : null, my_pp);
|
Helper.loadGiF(PeertubeActivity.this, account.getAvatar() != null ? account.getAvatar().getPath() : null, binding.myPp);
|
||||||
|
Helper.loadGiF(PeertubeActivity.this, account.getAvatar() != null ? account.getAvatar().getPath() : null, binding.myPpReply);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if (Helper.isTablet(PeertubeActivity.this)) {
|
if (Helper.isTablet(PeertubeActivity.this)) {
|
||||||
RelativeLayout video_container = findViewById(R.id.video_container);
|
|
||||||
LinearLayout.LayoutParams param = new LinearLayout.LayoutParams(
|
LinearLayout.LayoutParams param = new LinearLayout.LayoutParams(
|
||||||
LinearLayout.LayoutParams.MATCH_PARENT,
|
LinearLayout.LayoutParams.MATCH_PARENT,
|
||||||
0,
|
0,
|
||||||
2.0f
|
2.0f
|
||||||
);
|
);
|
||||||
video_container.setLayoutParams(param);
|
binding.videoContainer.setLayoutParams(param);
|
||||||
}
|
}
|
||||||
|
isPlayInMinimized = false;
|
||||||
if (getSupportActionBar() != null)
|
if (getSupportActionBar() != null)
|
||||||
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
|
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
|
||||||
|
|
||||||
@ -231,6 +215,10 @@ public class PeertubeActivity extends AppCompatActivity implements CommentListAd
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
if( !Helper.isLoggedIn(PeertubeActivity.this) || sepiaSearch) {
|
||||||
|
binding.writeCommentContainerReply.setVisibility(View.GONE);
|
||||||
|
binding.writeCommentContainer.setVisibility(View.GONE);
|
||||||
|
}
|
||||||
playInMinimized = sharedpreferences.getBoolean(getString(R.string.set_video_minimize_choice), true);
|
playInMinimized = sharedpreferences.getBoolean(getString(R.string.set_video_minimize_choice), true);
|
||||||
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.N
|
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.N
|
||||||
&& !getPackageManager().hasSystemFeature(PackageManager.FEATURE_PICTURE_IN_PICTURE)) {
|
&& !getPackageManager().hasSystemFeature(PackageManager.FEATURE_PICTURE_IN_PICTURE)) {
|
||||||
@ -238,23 +226,21 @@ public class PeertubeActivity extends AppCompatActivity implements CommentListAd
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (mode == Helper.VIDEO_MODE_WEBVIEW) {
|
if (mode == Helper.VIDEO_MODE_WEBVIEW) {
|
||||||
webview_video.setVisibility(View.VISIBLE);
|
binding.webviewVideo.setVisibility(View.VISIBLE);
|
||||||
playerView.setVisibility(View.GONE);
|
binding.mediaVideo.setVisibility(View.GONE);
|
||||||
webview_video = Helper.initializeWebview(PeertubeActivity.this, R.id.webview_video, null);
|
CustomWebview webview_video = Helper.initializeWebview(PeertubeActivity.this, R.id.webview_video, null);
|
||||||
FrameLayout webview_container = findViewById(R.id.main_media_frame);
|
|
||||||
final ViewGroup videoLayout = findViewById(R.id.videoLayout);
|
|
||||||
|
|
||||||
MastalabWebChromeClient mastalabWebChromeClient = new MastalabWebChromeClient(PeertubeActivity.this, webview_video, webview_container, videoLayout);
|
MastalabWebChromeClient mastalabWebChromeClient = new MastalabWebChromeClient(PeertubeActivity.this, webview_video, binding.mainMediaFrame, binding.videoLayout);
|
||||||
mastalabWebChromeClient.setOnToggledFullscreen(fullscreen -> {
|
mastalabWebChromeClient.setOnToggledFullscreen(fullscreen -> {
|
||||||
|
|
||||||
if (fullscreen) {
|
if (fullscreen) {
|
||||||
videoLayout.setVisibility(View.VISIBLE);
|
binding.videoLayout.setVisibility(View.VISIBLE);
|
||||||
WindowManager.LayoutParams attrs = getWindow().getAttributes();
|
WindowManager.LayoutParams attrs = getWindow().getAttributes();
|
||||||
attrs.flags |= WindowManager.LayoutParams.FLAG_FULLSCREEN;
|
attrs.flags |= WindowManager.LayoutParams.FLAG_FULLSCREEN;
|
||||||
attrs.flags |= WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON;
|
attrs.flags |= WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON;
|
||||||
getWindow().setAttributes(attrs);
|
getWindow().setAttributes(attrs);
|
||||||
getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_LOW_PROFILE);
|
getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_LOW_PROFILE);
|
||||||
peertube_information_container.setVisibility(View.GONE);
|
binding.peertubeInformationContainer.setVisibility(View.GONE);
|
||||||
setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE);
|
setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE);
|
||||||
} else {
|
} else {
|
||||||
WindowManager.LayoutParams attrs = getWindow().getAttributes();
|
WindowManager.LayoutParams attrs = getWindow().getAttributes();
|
||||||
@ -262,39 +248,41 @@ public class PeertubeActivity extends AppCompatActivity implements CommentListAd
|
|||||||
attrs.flags &= ~WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON;
|
attrs.flags &= ~WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON;
|
||||||
getWindow().setAttributes(attrs);
|
getWindow().setAttributes(attrs);
|
||||||
getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_VISIBLE);
|
getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_VISIBLE);
|
||||||
videoLayout.setVisibility(View.GONE);
|
binding.videoLayout.setVisibility(View.GONE);
|
||||||
peertube_information_container.setVisibility(View.VISIBLE);
|
binding.peertubeInformationContainer.setVisibility(View.VISIBLE);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
webview_video.getSettings().setAllowFileAccess(true);
|
binding.webviewVideo.getSettings().setAllowFileAccess(true);
|
||||||
webview_video.setWebChromeClient(mastalabWebChromeClient);
|
binding.webviewVideo.setWebChromeClient(mastalabWebChromeClient);
|
||||||
webview_video.getSettings().setDomStorageEnabled(true);
|
binding.webviewVideo.getSettings().setDomStorageEnabled(true);
|
||||||
webview_video.getSettings().setAppCacheEnabled(true);
|
binding.webviewVideo.getSettings().setAppCacheEnabled(true);
|
||||||
webview_video.getSettings().setMediaPlaybackRequiresUserGesture(false);
|
binding.webviewVideo.getSettings().setMediaPlaybackRequiresUserGesture(false);
|
||||||
webview_video.setWebViewClient(new MastalabWebViewClient(PeertubeActivity.this));
|
binding.webviewVideo.setWebViewClient(new MastalabWebViewClient(PeertubeActivity.this));
|
||||||
webview_video.loadUrl("https://" + peertubeInstance + "/videos/embed/" + videoUuid);
|
binding.webviewVideo.loadUrl("https://" + peertubeInstance + "/videos/embed/" + videoUuid);
|
||||||
} else {
|
} else {
|
||||||
webview_video.setVisibility(View.GONE);
|
binding.webviewVideo.setVisibility(View.GONE);
|
||||||
playerView.setVisibility(View.VISIBLE);
|
binding.mediaVideo.setVisibility(View.VISIBLE);
|
||||||
loader.setVisibility(View.VISIBLE);
|
binding.loader.setVisibility(View.VISIBLE);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (mode != Helper.VIDEO_MODE_WEBVIEW) {
|
if (mode != Helper.VIDEO_MODE_WEBVIEW) {
|
||||||
playerView.setControllerShowTimeoutMs(1000);
|
binding.mediaVideo.setControllerShowTimeoutMs(1000);
|
||||||
playerView.setResizeMode(AspectRatioFrameLayout.RESIZE_MODE_FIT);
|
binding.mediaVideo.setResizeMode(AspectRatioFrameLayout.RESIZE_MODE_FIT);
|
||||||
initFullscreenDialog();
|
initFullscreenDialog();
|
||||||
initFullscreenButton();
|
initFullscreenButton();
|
||||||
}
|
}
|
||||||
flag_loading = true;
|
flag_loading = true;
|
||||||
comments = new ArrayList<>();
|
comments = new ArrayList<>();
|
||||||
lv_comments = findViewById(R.id.peertube_comments);
|
|
||||||
commentListAdapter = new CommentListAdapter(comments, Helper.isVideoOwner(PeertubeActivity.this, peertube));
|
binding.closeReply.setOnClickListener(v->closeCommentThread());
|
||||||
|
|
||||||
|
commentListAdapter = new CommentListAdapter(comments, isMyVideo || Helper.isVideoOwner(PeertubeActivity.this, peertube));
|
||||||
commentListAdapter.allCommentRemoved = PeertubeActivity.this;
|
commentListAdapter.allCommentRemoved = PeertubeActivity.this;
|
||||||
LinearLayoutManager mLayoutManager = new LinearLayoutManager(PeertubeActivity.this);
|
LinearLayoutManager mLayoutManager = new LinearLayoutManager(PeertubeActivity.this);
|
||||||
lv_comments.setLayoutManager(mLayoutManager);
|
binding.peertubeComments.setLayoutManager(mLayoutManager);
|
||||||
lv_comments.setNestedScrollingEnabled(false);
|
binding.peertubeComments.setNestedScrollingEnabled(false);
|
||||||
lv_comments.setAdapter(commentListAdapter);
|
binding.peertubeComments.setAdapter(commentListAdapter);
|
||||||
lv_comments.addOnScrollListener(new RecyclerView.OnScrollListener() {
|
binding.peertubeComments.addOnScrollListener(new RecyclerView.OnScrollListener() {
|
||||||
public void onScrolled(@NonNull RecyclerView recyclerView, int dx, int dy) {
|
public void onScrolled(@NonNull RecyclerView recyclerView, int dx, int dy) {
|
||||||
if (dy > 0) {
|
if (dy > 0) {
|
||||||
int visibleItemCount = mLayoutManager.getChildCount();
|
int visibleItemCount = mLayoutManager.getChildCount();
|
||||||
@ -315,8 +303,11 @@ public class PeertubeActivity extends AppCompatActivity implements CommentListAd
|
|||||||
}else {
|
}else {
|
||||||
playVideo();
|
playVideo();
|
||||||
}
|
}
|
||||||
|
registBroadcastReceiver();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
private void manageVIewVideos(APIResponse apiResponse) {
|
private void manageVIewVideos(APIResponse apiResponse) {
|
||||||
if( apiResponse == null || apiResponse.getPeertubes() == null || apiResponse.getPeertubes().size() == 0) {
|
if( apiResponse == null || apiResponse.getPeertubes() == null || apiResponse.getPeertubes().size() == 0) {
|
||||||
playVideo();
|
playVideo();
|
||||||
@ -345,11 +336,46 @@ public class PeertubeActivity extends AppCompatActivity implements CommentListAd
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (comments.size() > 0) {
|
if (comments.size() > 0) {
|
||||||
lv_comments.setVisibility(View.VISIBLE);
|
binding.peertubeComments.setVisibility(View.VISIBLE);
|
||||||
commentListAdapter.notifyItemRangeInserted(oldSize, newComments);
|
commentListAdapter.notifyItemRangeInserted(oldSize, newComments);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public void manageVIewCommentReply(APIResponse apiResponse) {
|
||||||
|
if (apiResponse == null || apiResponse.getError() != null || apiResponse.getCommentThreadData() == null) {
|
||||||
|
if (apiResponse == null || apiResponse.getError() == null)
|
||||||
|
Toasty.error(PeertubeActivity.this, getString(R.string.toast_error), Toast.LENGTH_LONG).show();
|
||||||
|
else
|
||||||
|
Toasty.error(PeertubeActivity.this, apiResponse.getError().getError(), Toast.LENGTH_LONG).show();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
List<CommentData.CommentThreadData> commentThreadDataList = apiResponse.getCommentThreadData().getChildren();
|
||||||
|
commentsThread = generateCommentReply(commentThreadDataList, new ArrayList<>());
|
||||||
|
commentReplyListAdapter = new CommentListAdapter(commentsThread, Helper.isVideoOwner(PeertubeActivity.this, peertube));
|
||||||
|
LinearLayoutManager mLayoutManager = new LinearLayoutManager(PeertubeActivity.this);
|
||||||
|
binding.peertubeReply.setLayoutManager(mLayoutManager);
|
||||||
|
binding.peertubeReply.setNestedScrollingEnabled(false);
|
||||||
|
binding.peertubeReply.setAdapter(commentReplyListAdapter);
|
||||||
|
binding.peertubeReply.setVisibility(View.VISIBLE);
|
||||||
|
if (commentsThread.size() > 0) {
|
||||||
|
commentReplyListAdapter.notifyItemRangeInserted(0, commentsThread.size());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private List<Comment> generateCommentReply(List<CommentData.CommentThreadData> commentThreadDataList, List<Comment> comments) {
|
||||||
|
for (CommentData.CommentThreadData commentThreadData : commentThreadDataList) {
|
||||||
|
if (commentThreadData.getComment().getText() != null && commentThreadData.getComment().getText().trim().length() > 0) {
|
||||||
|
commentThreadData.getComment().setReply(true);
|
||||||
|
comments.add(commentThreadData.getComment());
|
||||||
|
}
|
||||||
|
if( commentThreadData.getChildren() != null && commentThreadData.getChildren().size() >0) {
|
||||||
|
generateCommentReply(commentThreadData.getChildren(), comments);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return comments;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onNewIntent(Intent intent) {
|
public void onNewIntent(Intent intent) {
|
||||||
super.onNewIntent(intent);
|
super.onNewIntent(intent);
|
||||||
@ -366,8 +392,8 @@ public class PeertubeActivity extends AppCompatActivity implements CommentListAd
|
|||||||
player.setPlayWhenReady(false);
|
player.setPlayWhenReady(false);
|
||||||
player.release();
|
player.release();
|
||||||
player = ExoPlayerFactory.newSimpleInstance(PeertubeActivity.this);
|
player = ExoPlayerFactory.newSimpleInstance(PeertubeActivity.this);
|
||||||
playerView.setPlayer(player);
|
binding.mediaVideo.setPlayer(player);
|
||||||
loader.setVisibility(View.GONE);
|
binding.loader.setVisibility(View.GONE);
|
||||||
player.setPlayWhenReady(true);
|
player.setPlayWhenReady(true);
|
||||||
captions = null;
|
captions = null;
|
||||||
}
|
}
|
||||||
@ -375,8 +401,8 @@ public class PeertubeActivity extends AppCompatActivity implements CommentListAd
|
|||||||
setFullscreen(FullScreenMediaController.fullscreen.OFF);
|
setFullscreen(FullScreenMediaController.fullscreen.OFF);
|
||||||
fullScreenMode = false;
|
fullScreenMode = false;
|
||||||
|
|
||||||
peertube_playlist.setVisibility(View.VISIBLE);
|
binding.peertubePlaylist.setVisibility(View.VISIBLE);
|
||||||
peertube_bookmark.setVisibility(View.GONE);
|
binding.peertubeBookmark.setVisibility(View.GONE);
|
||||||
TimelineVM feedsViewModel = new ViewModelProvider(PeertubeActivity.this).get(TimelineVM.class);
|
TimelineVM feedsViewModel = new ViewModelProvider(PeertubeActivity.this).get(TimelineVM.class);
|
||||||
feedsViewModel.getVideo(sepiaSearch?peertubeInstance:null, videoUuid, isMyVideo).observe(PeertubeActivity.this, this::manageVIewVideo);
|
feedsViewModel.getVideo(sepiaSearch?peertubeInstance:null, videoUuid, isMyVideo).observe(PeertubeActivity.this, this::manageVIewVideo);
|
||||||
CaptionsVM captionsViewModel = new ViewModelProvider(PeertubeActivity.this).get(CaptionsVM.class);
|
CaptionsVM captionsViewModel = new ViewModelProvider(PeertubeActivity.this).get(CaptionsVM.class);
|
||||||
@ -388,37 +414,15 @@ public class PeertubeActivity extends AppCompatActivity implements CommentListAd
|
|||||||
getWindow().addFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN |
|
getWindow().addFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN |
|
||||||
WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);
|
WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);
|
||||||
Objects.requireNonNull(getSupportActionBar()).hide();
|
Objects.requireNonNull(getSupportActionBar()).hide();
|
||||||
peertube_information_container.setVisibility(View.GONE);
|
binding.peertubeInformationContainer.setVisibility(View.GONE);
|
||||||
} else {
|
} else {
|
||||||
getWindow().setFlags(WindowManager.LayoutParams.FLAG_LAYOUT_IN_SCREEN,
|
getWindow().setFlags(WindowManager.LayoutParams.FLAG_LAYOUT_IN_SCREEN,
|
||||||
WindowManager.LayoutParams.FLAG_LAYOUT_IN_SCREEN);
|
WindowManager.LayoutParams.FLAG_LAYOUT_IN_SCREEN);
|
||||||
Objects.requireNonNull(getSupportActionBar()).show();
|
Objects.requireNonNull(getSupportActionBar()).show();
|
||||||
peertube_information_container.setVisibility(View.VISIBLE);
|
binding.peertubeInformationContainer.setVisibility(View.VISIBLE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean dispatchTouchEvent(MotionEvent ev) {
|
|
||||||
View v = getCurrentFocus();
|
|
||||||
|
|
||||||
if ((ev.getAction() == MotionEvent.ACTION_UP || ev.getAction() == MotionEvent.ACTION_MOVE) &&
|
|
||||||
v instanceof EditText &&
|
|
||||||
v.getId() == R.id.add_comment_write) {
|
|
||||||
int[] scrcoords = new int[2];
|
|
||||||
v.getLocationOnScreen(scrcoords);
|
|
||||||
float x = ev.getRawX() + v.getLeft() - scrcoords[0];
|
|
||||||
float y = ev.getRawY() + v.getTop() - scrcoords[1];
|
|
||||||
|
|
||||||
if (x < v.getLeft() || x > v.getRight() || y < v.getTop() || y > v.getBottom()) {
|
|
||||||
add_comment_read.setVisibility(View.VISIBLE);
|
|
||||||
add_comment_write.setVisibility(View.GONE);
|
|
||||||
send.setVisibility(View.GONE);
|
|
||||||
hideKeyboard(PeertubeActivity.this);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return super.dispatchTouchEvent(ev);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean onOptionsItemSelected(MenuItem item) {
|
public boolean onOptionsItemSelected(MenuItem item) {
|
||||||
@ -438,8 +442,8 @@ public class PeertubeActivity extends AppCompatActivity implements CommentListAd
|
|||||||
LayoutInflater inflater1 = getLayoutInflater();
|
LayoutInflater inflater1 = getLayoutInflater();
|
||||||
View dialogView = inflater1.inflate(R.layout.popup_report, new LinearLayout(PeertubeActivity.this), false);
|
View dialogView = inflater1.inflate(R.layout.popup_report, new LinearLayout(PeertubeActivity.this), false);
|
||||||
dialogBuilder.setView(dialogView);
|
dialogBuilder.setView(dialogView);
|
||||||
EditText report_content = dialogView.findViewById(R.id.report_content);
|
|
||||||
dialogBuilder.setNeutralButton(R.string.cancel, (dialog, id) -> dialog.dismiss());
|
dialogBuilder.setNeutralButton(R.string.cancel, (dialog, id) -> dialog.dismiss());
|
||||||
|
EditText report_content = dialogView.findViewById(R.id.report_content);
|
||||||
dialogBuilder.setPositiveButton(R.string.report, (dialog, id) -> {
|
dialogBuilder.setPositiveButton(R.string.report, (dialog, id) -> {
|
||||||
if (report_content.getText().toString().trim().length() == 0) {
|
if (report_content.getText().toString().trim().length() == 0) {
|
||||||
Toasty.info(PeertubeActivity.this, getString(R.string.report_comment_size), Toasty.LENGTH_LONG).show();
|
Toasty.info(PeertubeActivity.this, getString(R.string.report_comment_size), Toasty.LENGTH_LONG).show();
|
||||||
@ -451,7 +455,7 @@ public class PeertubeActivity extends AppCompatActivity implements CommentListAd
|
|||||||
videoReport.setId(peertube.getId());
|
videoReport.setId(peertube.getId());
|
||||||
report.setVideo(videoReport);
|
report.setVideo(videoReport);
|
||||||
report.setReason(report_content.getText().toString());
|
report.setReason(report_content.getText().toString());
|
||||||
viewModel.report(report).observe(PeertubeActivity.this, apiResponse -> manageVIewPostActions(RetrofitPeertubeAPI.ActionType.REPORT_VIDEO, apiResponse));
|
viewModel.report(report).observe(PeertubeActivity.this, apiResponse -> manageVIewPostActions(RetrofitPeertubeAPI.ActionType.REPORT_VIDEO,0, apiResponse));
|
||||||
alertDialog.dismiss();
|
alertDialog.dismiss();
|
||||||
dialog.dismiss();
|
dialog.dismiss();
|
||||||
} else if (type == RetrofitPeertubeAPI.ActionType.REPORT_ACCOUNT) {
|
} else if (type == RetrofitPeertubeAPI.ActionType.REPORT_ACCOUNT) {
|
||||||
@ -460,7 +464,7 @@ public class PeertubeActivity extends AppCompatActivity implements CommentListAd
|
|||||||
accountReport.setId(peertube.getAccount().getId());
|
accountReport.setId(peertube.getAccount().getId());
|
||||||
report.setAccount(accountReport);
|
report.setAccount(accountReport);
|
||||||
report.setReason(report_content.getText().toString());
|
report.setReason(report_content.getText().toString());
|
||||||
viewModel.report(report).observe(PeertubeActivity.this, apiResponse -> manageVIewPostActions(RetrofitPeertubeAPI.ActionType.REPORT_ACCOUNT, apiResponse));
|
viewModel.report(report).observe(PeertubeActivity.this, apiResponse -> manageVIewPostActions(RetrofitPeertubeAPI.ActionType.REPORT_ACCOUNT, 0,apiResponse));
|
||||||
alertDialog.dismiss();
|
alertDialog.dismiss();
|
||||||
dialog.dismiss();
|
dialog.dismiss();
|
||||||
}
|
}
|
||||||
@ -492,12 +496,12 @@ public class PeertubeActivity extends AppCompatActivity implements CommentListAd
|
|||||||
|
|
||||||
if (apiResponse == null || (apiResponse.getError() != null) || apiResponse.getPeertubes() == null || apiResponse.getPeertubes().size() == 0) {
|
if (apiResponse == null || (apiResponse.getError() != null) || apiResponse.getPeertubes() == null || apiResponse.getPeertubes().size() == 0) {
|
||||||
Toasty.error(PeertubeActivity.this, getString(R.string.toast_error), Toast.LENGTH_LONG).show();
|
Toasty.error(PeertubeActivity.this, getString(R.string.toast_error), Toast.LENGTH_LONG).show();
|
||||||
loader.setVisibility(View.GONE);
|
binding.loader.setVisibility(View.GONE);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (apiResponse.getPeertubes() == null || apiResponse.getPeertubes().get(0) == null || apiResponse.getPeertubes().get(0).getFileUrl(null, PeertubeActivity.this) == null) {
|
if (apiResponse.getPeertubes() == null || apiResponse.getPeertubes().get(0) == null || apiResponse.getPeertubes().get(0).getFileUrl(null, PeertubeActivity.this) == null) {
|
||||||
Toasty.error(PeertubeActivity.this, getString(R.string.toast_error), Toast.LENGTH_LONG).show();
|
Toasty.error(PeertubeActivity.this, getString(R.string.toast_error), Toast.LENGTH_LONG).show();
|
||||||
loader.setVisibility(View.GONE);
|
binding.loader.setVisibility(View.GONE);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -511,34 +515,17 @@ public class PeertubeActivity extends AppCompatActivity implements CommentListAd
|
|||||||
PlaylistsVM viewModel = new ViewModelProvider(this).get(PlaylistsVM.class);
|
PlaylistsVM viewModel = new ViewModelProvider(this).get(PlaylistsVM.class);
|
||||||
viewModel.videoExists(videoIds).observe(this, this::manageVIewPlaylist);
|
viewModel.videoExists(videoIds).observe(this, this::manageVIewPlaylist);
|
||||||
|
|
||||||
|
if( !Helper.isLoggedIn(PeertubeActivity.this) || sepiaSearch) {
|
||||||
add_comment_read.setOnClickListener(v -> {
|
binding.writeCommentContainer.setVisibility(View.GONE);
|
||||||
if (isLoggedIn(PeertubeActivity.this) && !sepiaSearch) {
|
binding.writeCommentContainerReply.setVisibility(View.GONE);
|
||||||
add_comment_read.setVisibility(View.GONE);
|
|
||||||
add_comment_write.setVisibility(View.VISIBLE);
|
|
||||||
send.setVisibility(View.VISIBLE);
|
|
||||||
add_comment_write.requestFocus();
|
|
||||||
add_comment_write.setSelection(add_comment_write.getText().length());
|
|
||||||
} else {
|
|
||||||
if( sepiaSearch) {
|
|
||||||
Toasty.info(PeertubeActivity.this, getString(R.string.federation_issue), Toasty.LENGTH_SHORT).show();
|
|
||||||
}else {
|
|
||||||
Toasty.error(PeertubeActivity.this, getString(R.string.not_logged_in), Toast.LENGTH_SHORT).show();
|
|
||||||
}
|
}
|
||||||
}
|
binding.send.setOnClickListener(v -> {
|
||||||
|
|
||||||
});
|
|
||||||
send.setOnClickListener(v -> {
|
|
||||||
if (isLoggedIn(PeertubeActivity.this) && !sepiaSearch) {
|
if (isLoggedIn(PeertubeActivity.this) && !sepiaSearch) {
|
||||||
String comment = add_comment_write.getText().toString();
|
String comment = binding.addCommentWrite.getText().toString();
|
||||||
if (comment.trim().length() > 0) {
|
if (comment.trim().length() > 0) {
|
||||||
PostActionsVM viewModelComment = new ViewModelProvider(PeertubeActivity.this).get(PostActionsVM.class);
|
PostActionsVM viewModelComment = new ViewModelProvider(PeertubeActivity.this).get(PostActionsVM.class);
|
||||||
viewModelComment.comment(ADD_COMMENT, peertube.getId(), null, comment).observe(PeertubeActivity.this, apiResponse1 -> manageVIewPostActions(ADD_COMMENT, apiResponse1));
|
viewModelComment.comment(ADD_COMMENT, peertube.getId(), null, comment).observe(PeertubeActivity.this, apiResponse1 -> manageVIewPostActions(ADD_COMMENT, 0, apiResponse1));
|
||||||
add_comment_write.setText("");
|
binding.addCommentWrite.setText("");
|
||||||
add_comment_read.setVisibility(View.VISIBLE);
|
|
||||||
add_comment_write.setVisibility(View.GONE);
|
|
||||||
send.setVisibility(View.GONE);
|
|
||||||
add_comment_read.requestFocus();
|
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if( sepiaSearch) {
|
if( sepiaSearch) {
|
||||||
@ -549,47 +536,48 @@ public class PeertubeActivity extends AppCompatActivity implements CommentListAd
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
binding.peertubePlaylist.setOnClickListener(v -> {
|
||||||
peertube_playlist.setOnClickListener(v -> {
|
|
||||||
PlaylistsVM viewModelOwnerPlaylist = new ViewModelProvider(PeertubeActivity.this).get(PlaylistsVM.class);
|
PlaylistsVM viewModelOwnerPlaylist = new ViewModelProvider(PeertubeActivity.this).get(PlaylistsVM.class);
|
||||||
viewModelOwnerPlaylist.manage(PlaylistsVM.action.GET_PLAYLISTS, null, null).observe(PeertubeActivity.this, this::manageVIewPlaylists);
|
viewModelOwnerPlaylist.manage(PlaylistsVM.action.GET_PLAYLISTS, null, null).observe(PeertubeActivity.this, this::manageVIewPlaylists);
|
||||||
});
|
});
|
||||||
no_action_text = findViewById(R.id.no_action_text);
|
|
||||||
|
|
||||||
if (peertube.isCommentsEnabled()) {
|
if (peertube.isCommentsEnabled()) {
|
||||||
CommentVM commentViewModel = new ViewModelProvider(PeertubeActivity.this).get(CommentVM.class);
|
CommentVM commentViewModel = new ViewModelProvider(PeertubeActivity.this).get(CommentVM.class);
|
||||||
commentViewModel.getThread(sepiaSearch?peertubeInstance:null, videoUuid, max_id).observe(PeertubeActivity.this, this::manageVIewComment);
|
commentViewModel.getThread(sepiaSearch?peertubeInstance:null, videoUuid, max_id).observe(PeertubeActivity.this, this::manageVIewComment);
|
||||||
write_comment_container.setVisibility(View.VISIBLE);
|
if( Helper.isLoggedIn(PeertubeActivity.this) && !sepiaSearch) {
|
||||||
|
binding.writeCommentContainerReply.setVisibility(View.VISIBLE);
|
||||||
|
binding.writeCommentContainer.setVisibility(View.VISIBLE);
|
||||||
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
RelativeLayout no_action = findViewById(R.id.no_action);
|
binding.writeCommentContainerReply.setVisibility(View.GONE);
|
||||||
|
binding.writeCommentContainer.setVisibility(View.GONE);
|
||||||
no_action_text.setText(getString(R.string.comment_no_allowed_peertube));
|
binding.noActionText.setText(getString(R.string.comment_no_allowed_peertube));
|
||||||
no_action.setVisibility(View.VISIBLE);
|
binding.noAction.setVisibility(View.VISIBLE);
|
||||||
write_comment_container.setVisibility(View.GONE);
|
binding.writeCommentContainer.setVisibility(View.GONE);
|
||||||
}
|
}
|
||||||
SharedPreferences sharedpreferences = getSharedPreferences(Helper.APP_PREFS, MODE_PRIVATE);
|
SharedPreferences sharedpreferences = getSharedPreferences(Helper.APP_PREFS, MODE_PRIVATE);
|
||||||
setTitle(peertube.getName());
|
setTitle(peertube.getName());
|
||||||
|
|
||||||
peertube_description.setText(peertube.getDescription());
|
binding.peertubeDescription.setText(peertube.getDescription());
|
||||||
|
|
||||||
|
|
||||||
peertube_title.setText(peertube.getName());
|
binding.peertubeTitle.setText(peertube.getName());
|
||||||
peertube_dislike_count.setText(String.valueOf(peertube.getDislikes()));
|
binding.peertubeDislikeCount.setText(Helper.withSuffix(peertube.getDislikes()));
|
||||||
peertube_like_count.setText(String.valueOf(peertube.getLikes()));
|
binding.peertubeLikeCount.setText(Helper.withSuffix(peertube.getLikes()));
|
||||||
peertube_view_count.setText(String.valueOf(peertube.getViews()));
|
binding.peertubeViewCount.setText(Helper.withSuffix(peertube.getViews()));
|
||||||
video_id = peertube.getId();
|
video_id = peertube.getId();
|
||||||
|
|
||||||
changeColor();
|
changeColor();
|
||||||
initResolution();
|
initResolution();
|
||||||
|
|
||||||
peertube_like_count.setOnClickListener(v -> {
|
binding.peertubeLikeCount.setOnClickListener(v -> {
|
||||||
if (isLoggedIn(PeertubeActivity.this) && !sepiaSearch) {
|
if (isLoggedIn(PeertubeActivity.this) && !sepiaSearch) {
|
||||||
String newState = peertube.getMyRating().equals("like") ? "none" : "like";
|
String newState = peertube.getMyRating().equals("like") ? "none" : "like";
|
||||||
PostActionsVM viewModelLike = new ViewModelProvider(PeertubeActivity.this).get(PostActionsVM.class);
|
PostActionsVM viewModelLike = new ViewModelProvider(PeertubeActivity.this).get(PostActionsVM.class);
|
||||||
viewModelLike.post(RATEVIDEO, peertube.getId(), newState).observe(PeertubeActivity.this, apiResponse1 -> manageVIewPostActions(RATEVIDEO, apiResponse1));
|
viewModelLike.post(RATEVIDEO, peertube.getId(), newState).observe(PeertubeActivity.this, apiResponse1 -> manageVIewPostActions(RATEVIDEO, 0, apiResponse1));
|
||||||
peertube.setMyRating(newState);
|
peertube.setMyRating(newState);
|
||||||
int count = Integer.parseInt(peertube_like_count.getText().toString());
|
int count = Integer.parseInt(binding.peertubeLikeCount.getText().toString());
|
||||||
if (newState.compareTo("none") == 0) {
|
if (newState.compareTo("none") == 0) {
|
||||||
count--;
|
count--;
|
||||||
if (count - 1 < 0) {
|
if (count - 1 < 0) {
|
||||||
@ -598,7 +586,7 @@ public class PeertubeActivity extends AppCompatActivity implements CommentListAd
|
|||||||
} else {
|
} else {
|
||||||
count++;
|
count++;
|
||||||
}
|
}
|
||||||
peertube_like_count.setText(String.valueOf(count));
|
binding.peertubeLikeCount.setText(String.valueOf(count));
|
||||||
changeColor();
|
changeColor();
|
||||||
} else {
|
} else {
|
||||||
if( sepiaSearch) {
|
if( sepiaSearch) {
|
||||||
@ -608,13 +596,13 @@ public class PeertubeActivity extends AppCompatActivity implements CommentListAd
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
peertube_dislike_count.setOnClickListener(v -> {
|
binding.peertubeDislikeCount.setOnClickListener(v -> {
|
||||||
if (isLoggedIn(PeertubeActivity.this) && !sepiaSearch) {
|
if (isLoggedIn(PeertubeActivity.this) && !sepiaSearch) {
|
||||||
String newState = peertube.getMyRating().equals("dislike") ? "none" : "dislike";
|
String newState = peertube.getMyRating().equals("dislike") ? "none" : "dislike";
|
||||||
PostActionsVM viewModelLike = new ViewModelProvider(PeertubeActivity.this).get(PostActionsVM.class);
|
PostActionsVM viewModelLike = new ViewModelProvider(PeertubeActivity.this).get(PostActionsVM.class);
|
||||||
viewModelLike.post(RATEVIDEO, peertube.getId(), newState).observe(PeertubeActivity.this, apiResponse1 -> manageVIewPostActions(RATEVIDEO, apiResponse1));
|
viewModelLike.post(RATEVIDEO, peertube.getId(), newState).observe(PeertubeActivity.this, apiResponse1 -> manageVIewPostActions(RATEVIDEO,0, apiResponse1));
|
||||||
peertube.setMyRating(newState);
|
peertube.setMyRating(newState);
|
||||||
int count = Integer.parseInt(peertube_dislike_count.getText().toString());
|
int count = Integer.parseInt(binding.peertubeDislikeCount.getText().toString());
|
||||||
if (newState.compareTo("none") == 0) {
|
if (newState.compareTo("none") == 0) {
|
||||||
count--;
|
count--;
|
||||||
if (count - 1 < 0) {
|
if (count - 1 < 0) {
|
||||||
@ -623,7 +611,7 @@ public class PeertubeActivity extends AppCompatActivity implements CommentListAd
|
|||||||
} else {
|
} else {
|
||||||
count++;
|
count++;
|
||||||
}
|
}
|
||||||
peertube_dislike_count.setText(String.valueOf(count));
|
binding.peertubeDislikeCount.setText(String.valueOf(count));
|
||||||
changeColor();
|
changeColor();
|
||||||
} else {
|
} else {
|
||||||
if( sepiaSearch) {
|
if( sepiaSearch) {
|
||||||
@ -641,8 +629,8 @@ public class PeertubeActivity extends AppCompatActivity implements CommentListAd
|
|||||||
ProgressiveMediaSource videoSource;
|
ProgressiveMediaSource videoSource;
|
||||||
|
|
||||||
player = ExoPlayerFactory.newSimpleInstance(PeertubeActivity.this);
|
player = ExoPlayerFactory.newSimpleInstance(PeertubeActivity.this);
|
||||||
playerView.setPlayer(player);
|
binding.mediaVideo.setPlayer(player);
|
||||||
loader.setVisibility(View.GONE);
|
binding.loader.setVisibility(View.GONE);
|
||||||
|
|
||||||
if (apiResponse.getPeertubes().get(0).getFiles() != null && apiResponse.getPeertubes().get(0).getFiles().size() > 0) {
|
if (apiResponse.getPeertubes().get(0).getFiles() != null && apiResponse.getPeertubes().get(0).getFiles().size() > 0) {
|
||||||
if (video_cache == 0) {
|
if (video_cache == 0) {
|
||||||
@ -665,8 +653,8 @@ public class PeertubeActivity extends AppCompatActivity implements CommentListAd
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
more_actions.setOnClickListener(view -> {
|
binding.moreActions.setOnClickListener(view -> {
|
||||||
PopupMenu popup = new PopupMenu(PeertubeActivity.this, more_actions);
|
PopupMenu popup = new PopupMenu(PeertubeActivity.this, binding.moreActions);
|
||||||
popup.getMenuInflater()
|
popup.getMenuInflater()
|
||||||
.inflate(R.menu.main_video, popup.getMenu());
|
.inflate(R.menu.main_video, popup.getMenu());
|
||||||
|
|
||||||
@ -674,8 +662,8 @@ public class PeertubeActivity extends AppCompatActivity implements CommentListAd
|
|||||||
popup.getMenu().findItem(R.id.action_captions).setEnabled(false);
|
popup.getMenu().findItem(R.id.action_captions).setEnabled(false);
|
||||||
}
|
}
|
||||||
popup.setOnMenuItemClickListener(item -> {
|
popup.setOnMenuItemClickListener(item -> {
|
||||||
switch (item.getItemId()) {
|
int itemId = item.getItemId();
|
||||||
case R.id.action_download:
|
if (itemId == R.id.action_download) {
|
||||||
if (Build.VERSION.SDK_INT >= 23) {
|
if (Build.VERSION.SDK_INT >= 23) {
|
||||||
if (ContextCompat.checkSelfPermission(PeertubeActivity.this, Manifest.permission.WRITE_EXTERNAL_STORAGE) != PackageManager.PERMISSION_GRANTED || ContextCompat.checkSelfPermission(PeertubeActivity.this, Manifest.permission.READ_EXTERNAL_STORAGE) != PackageManager.PERMISSION_GRANTED) {
|
if (ContextCompat.checkSelfPermission(PeertubeActivity.this, Manifest.permission.WRITE_EXTERNAL_STORAGE) != PackageManager.PERMISSION_GRANTED || ContextCompat.checkSelfPermission(PeertubeActivity.this, Manifest.permission.READ_EXTERNAL_STORAGE) != PackageManager.PERMISSION_GRANTED) {
|
||||||
ActivityCompat.requestPermissions(PeertubeActivity.this, new String[]{Manifest.permission.WRITE_EXTERNAL_STORAGE}, Helper.EXTERNAL_STORAGE_REQUEST_CODE);
|
ActivityCompat.requestPermissions(PeertubeActivity.this, new String[]{Manifest.permission.WRITE_EXTERNAL_STORAGE}, Helper.EXTERNAL_STORAGE_REQUEST_CODE);
|
||||||
@ -685,8 +673,7 @@ public class PeertubeActivity extends AppCompatActivity implements CommentListAd
|
|||||||
} else {
|
} else {
|
||||||
Helper.manageDownloads(PeertubeActivity.this, peertube.getFileDownloadUrl(null));
|
Helper.manageDownloads(PeertubeActivity.this, peertube.getFileDownloadUrl(null));
|
||||||
}
|
}
|
||||||
break;
|
} else if (itemId == R.id.action_share) {
|
||||||
case R.id.action_share:
|
|
||||||
Intent sendIntent = new Intent(Intent.ACTION_SEND);
|
Intent sendIntent = new Intent(Intent.ACTION_SEND);
|
||||||
sendIntent.putExtra(Intent.EXTRA_SUBJECT, getString(R.string.shared_via));
|
sendIntent.putExtra(Intent.EXTRA_SUBJECT, getString(R.string.shared_via));
|
||||||
String url;
|
String url;
|
||||||
@ -699,10 +686,14 @@ public class PeertubeActivity extends AppCompatActivity implements CommentListAd
|
|||||||
extra_text += "\r\n\r\n" + peertube.getName();
|
extra_text += "\r\n\r\n" + peertube.getName();
|
||||||
extra_text += "\n\n\uD83D\uDD17 " + url + "\r\n-\n";
|
extra_text += "\n\n\uD83D\uDD17 " + url + "\r\n-\n";
|
||||||
final String contentToot;
|
final String contentToot;
|
||||||
|
if (peertube.getDescription() != null) {
|
||||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N)
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N)
|
||||||
contentToot = Html.fromHtml(peertube.getDescription(), Html.FROM_HTML_MODE_LEGACY).toString();
|
contentToot = Html.fromHtml(peertube.getDescription(), Html.FROM_HTML_MODE_LEGACY).toString();
|
||||||
else
|
else
|
||||||
contentToot = Html.fromHtml(peertube.getDescription()).toString();
|
contentToot = Html.fromHtml(peertube.getDescription()).toString();
|
||||||
|
} else {
|
||||||
|
contentToot = "";
|
||||||
|
}
|
||||||
extra_text += contentToot;
|
extra_text += contentToot;
|
||||||
} else {
|
} else {
|
||||||
extra_text = url;
|
extra_text = url;
|
||||||
@ -710,8 +701,7 @@ public class PeertubeActivity extends AppCompatActivity implements CommentListAd
|
|||||||
sendIntent.putExtra(Intent.EXTRA_TEXT, extra_text);
|
sendIntent.putExtra(Intent.EXTRA_TEXT, extra_text);
|
||||||
sendIntent.setType("text/plain");
|
sendIntent.setType("text/plain");
|
||||||
startActivity(Intent.createChooser(sendIntent, getString(R.string.share_with)));
|
startActivity(Intent.createChooser(sendIntent, getString(R.string.share_with)));
|
||||||
break;
|
} else if (itemId == R.id.action_captions) {
|
||||||
case R.id.action_captions:
|
|
||||||
AlertDialog.Builder dialogBuilder = new AlertDialog.Builder(PeertubeActivity.this);
|
AlertDialog.Builder dialogBuilder = new AlertDialog.Builder(PeertubeActivity.this);
|
||||||
if (captions == null) {
|
if (captions == null) {
|
||||||
return true;
|
return true;
|
||||||
@ -775,7 +765,7 @@ public class PeertubeActivity extends AppCompatActivity implements CommentListAd
|
|||||||
if (uri != null)
|
if (uri != null)
|
||||||
subtitleSource = new SingleSampleMediaSource.Factory(cacheDataSourceFactory).createMediaSource(uri, subtitleFormat, C.TIME_UNSET);
|
subtitleSource = new SingleSampleMediaSource.Factory(cacheDataSourceFactory).createMediaSource(uri, subtitleFormat, C.TIME_UNSET);
|
||||||
}
|
}
|
||||||
playerView.setPlayer(player);
|
binding.mediaVideo.setPlayer(player);
|
||||||
if (which > 0 && subtitleSource != null) {
|
if (which > 0 && subtitleSource != null) {
|
||||||
MergingMediaSource mergedSource =
|
MergingMediaSource mergedSource =
|
||||||
new MergingMediaSource(videoSource, subtitleSource);
|
new MergingMediaSource(videoSource, subtitleSource);
|
||||||
@ -796,25 +786,22 @@ public class PeertubeActivity extends AppCompatActivity implements CommentListAd
|
|||||||
});
|
});
|
||||||
dialogBuilder.setNegativeButton(R.string.cancel, (dialog, id) -> dialog.dismiss());
|
dialogBuilder.setNegativeButton(R.string.cancel, (dialog, id) -> dialog.dismiss());
|
||||||
|
|
||||||
androidx.appcompat.app.AlertDialog alertDialog = dialogBuilder.create();
|
AlertDialog alertDialog = dialogBuilder.create();
|
||||||
alertDialog.setTitle(getString(R.string.pickup_captions));
|
alertDialog.setTitle(getString(R.string.pickup_captions));
|
||||||
alertDialog.show();
|
alertDialog.show();
|
||||||
|
} else if (itemId == R.id.action_report) {
|
||||||
break;
|
AlertDialog alertDialog;
|
||||||
|
AlertDialog.Builder dialogBuilder;
|
||||||
case R.id.action_report:
|
dialogBuilder = new AlertDialog.Builder(PeertubeActivity.this);
|
||||||
dialogBuilder = new androidx.appcompat.app.AlertDialog.Builder(PeertubeActivity.this);
|
|
||||||
LayoutInflater inflater1 = getLayoutInflater();
|
LayoutInflater inflater1 = getLayoutInflater();
|
||||||
View dialogView = inflater1.inflate(R.layout.popup_report_choice, new LinearLayout(PeertubeActivity.this), false);
|
View dialogView = inflater1.inflate(R.layout.popup_report_choice, new LinearLayout(PeertubeActivity.this), false);
|
||||||
dialogBuilder.setView(dialogView);
|
dialogBuilder.setView(dialogView);
|
||||||
Button report_video = dialogView.findViewById(R.id.report_video);
|
|
||||||
Button report_account = dialogView.findViewById(R.id.report_account);
|
|
||||||
dialogBuilder.setNeutralButton(R.string.cancel, (dialog, id) -> dialog.dismiss());
|
dialogBuilder.setNeutralButton(R.string.cancel, (dialog, id) -> dialog.dismiss());
|
||||||
alertDialog = dialogBuilder.create();
|
alertDialog = dialogBuilder.create();
|
||||||
alertDialog.show();
|
alertDialog.show();
|
||||||
report_video.setOnClickListener(v -> reportAlert(REPORT_VIDEO, alertDialog));
|
dialogView.findViewById(R.id.report_video).setOnClickListener(v -> reportAlert(REPORT_VIDEO, alertDialog));
|
||||||
report_account.setOnClickListener(v -> reportAlert(REPORT_ACCOUNT, alertDialog));
|
dialogView.findViewById(R.id.report_account).setOnClickListener(v -> reportAlert(REPORT_ACCOUNT, alertDialog));
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
});
|
});
|
||||||
@ -845,10 +832,12 @@ public class PeertubeActivity extends AppCompatActivity implements CommentListAd
|
|||||||
@Override
|
@Override
|
||||||
public void onDestroy() {
|
public void onDestroy() {
|
||||||
super.onDestroy();
|
super.onDestroy();
|
||||||
|
binding = null;
|
||||||
if (player != null) {
|
if (player != null) {
|
||||||
player.setPlayWhenReady(false);
|
player.setPlayWhenReady(false);
|
||||||
player.release();
|
player.release();
|
||||||
}
|
}
|
||||||
|
unregisterReceiver();
|
||||||
if (fullScreenDialog != null && fullScreenDialog.isShowing()) {
|
if (fullScreenDialog != null && fullScreenDialog.isShowing()) {
|
||||||
fullScreenDialog.dismiss();
|
fullScreenDialog.dismiss();
|
||||||
}
|
}
|
||||||
@ -857,11 +846,47 @@ public class PeertubeActivity extends AppCompatActivity implements CommentListAd
|
|||||||
@Override
|
@Override
|
||||||
protected void onPause() {
|
protected void onPause() {
|
||||||
super.onPause();
|
super.onPause();
|
||||||
if (player != null && !playInMinimized) {
|
if (player != null && !isPlayInMinimized) {
|
||||||
player.setPlayWhenReady(false);
|
player.setPlayWhenReady(false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void registBroadcastReceiver() {
|
||||||
|
final IntentFilter theFilter = new IntentFilter();
|
||||||
|
theFilter.addAction(Intent.ACTION_SCREEN_ON);
|
||||||
|
theFilter.addAction(Intent.ACTION_SCREEN_OFF);
|
||||||
|
|
||||||
|
mPowerKeyReceiver = new BroadcastReceiver() {
|
||||||
|
@Override
|
||||||
|
public void onReceive(Context context, Intent intent) {
|
||||||
|
String strAction = intent.getAction();
|
||||||
|
if (strAction.equals(Intent.ACTION_SCREEN_OFF)) {
|
||||||
|
if (player != null && isPlayInMinimized) {
|
||||||
|
player.setPlayWhenReady(false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
getApplicationContext().registerReceiver(mPowerKeyReceiver, theFilter);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void unregisterReceiver() {
|
||||||
|
int apiLevel = Build.VERSION.SDK_INT;
|
||||||
|
|
||||||
|
if (apiLevel >= 7) {
|
||||||
|
try {
|
||||||
|
getApplicationContext().unregisterReceiver(mPowerKeyReceiver);
|
||||||
|
}
|
||||||
|
catch (IllegalArgumentException e) {
|
||||||
|
mPowerKeyReceiver = null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
getApplicationContext().unregisterReceiver(mPowerKeyReceiver);
|
||||||
|
mPowerKeyReceiver = null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
@RequiresApi(api = Build.VERSION_CODES.N)
|
@RequiresApi(api = Build.VERSION_CODES.N)
|
||||||
@Override
|
@Override
|
||||||
@ -871,12 +896,13 @@ public class PeertubeActivity extends AppCompatActivity implements CommentListAd
|
|||||||
|
|
||||||
private void enterVideoMode() {
|
private void enterVideoMode() {
|
||||||
if (playInMinimized && Build.VERSION.SDK_INT >= Build.VERSION_CODES.N && player != null) {
|
if (playInMinimized && Build.VERSION.SDK_INT >= Build.VERSION_CODES.N && player != null) {
|
||||||
|
isPlayInMinimized = true;
|
||||||
MediaSessionCompat mediaSession = new MediaSessionCompat(this, getPackageName());
|
MediaSessionCompat mediaSession = new MediaSessionCompat(this, getPackageName());
|
||||||
MediaSessionConnector mediaSessionConnector = new MediaSessionConnector(mediaSession);
|
MediaSessionConnector mediaSessionConnector = new MediaSessionConnector(mediaSession);
|
||||||
mediaSessionConnector.setPlayer(player);
|
mediaSessionConnector.setPlayer(player);
|
||||||
PlayerControlView controlView = playerView.findViewById(R.id.exo_controller);
|
PlayerControlView controlView = binding.mediaVideo.findViewById(R.id.exo_controller);
|
||||||
controlView.hide();
|
controlView.hide();
|
||||||
playerView.setControllerAutoShow(false);
|
binding.mediaVideo.setControllerAutoShow(false);
|
||||||
mediaSession.setActive(true);
|
mediaSession.setActive(true);
|
||||||
enterPictureInPictureMode();
|
enterPictureInPictureMode();
|
||||||
}
|
}
|
||||||
@ -885,12 +911,16 @@ public class PeertubeActivity extends AppCompatActivity implements CommentListAd
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onBackPressed() {
|
public void onBackPressed() {
|
||||||
|
if( binding.replyThread.getVisibility() == View.VISIBLE) {
|
||||||
|
closeCommentThread();
|
||||||
|
}else {
|
||||||
if (playInMinimized && player != null) {
|
if (playInMinimized && player != null) {
|
||||||
enterVideoMode();
|
enterVideoMode();
|
||||||
} else {
|
} else {
|
||||||
super.onBackPressed();
|
super.onBackPressed();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -900,6 +930,7 @@ public class PeertubeActivity extends AppCompatActivity implements CommentListAd
|
|||||||
} else {
|
} else {
|
||||||
setFullscreen(FullScreenMediaController.fullscreen.OFF);
|
setFullscreen(FullScreenMediaController.fullscreen.OFF);
|
||||||
if (onStopCalled) {
|
if (onStopCalled) {
|
||||||
|
isPlayInMinimized = false;
|
||||||
finishAndRemoveTask();
|
finishAndRemoveTask();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -915,7 +946,7 @@ public class PeertubeActivity extends AppCompatActivity implements CommentListAd
|
|||||||
public void onResume() {
|
public void onResume() {
|
||||||
super.onResume();
|
super.onResume();
|
||||||
onStopCalled = false;
|
onStopCalled = false;
|
||||||
if (player != null && !playInMinimized) {
|
if (player != null && !player.isPlaying()) {
|
||||||
player.setPlayWhenReady(true);
|
player.setPlayWhenReady(true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -937,18 +968,18 @@ public class PeertubeActivity extends AppCompatActivity implements CommentListAd
|
|||||||
builderSingle.setAdapter(arrayAdapter, (dialog, which) -> {
|
builderSingle.setAdapter(arrayAdapter, (dialog, which) -> {
|
||||||
String res = Objects.requireNonNull(arrayAdapter.getItem(which)).substring(0, Objects.requireNonNull(arrayAdapter.getItem(which)).length() - 1);
|
String res = Objects.requireNonNull(arrayAdapter.getItem(which)).substring(0, Objects.requireNonNull(arrayAdapter.getItem(which)).length() - 1);
|
||||||
|
|
||||||
if (playerView != null) {
|
if (binding.mediaVideo != null) {
|
||||||
loader.setVisibility(View.VISIBLE);
|
binding.loader.setVisibility(View.VISIBLE);
|
||||||
long position = player.getCurrentPosition();
|
long position = player.getCurrentPosition();
|
||||||
PlayerControlView controlView = playerView.findViewById(R.id.exo_controller);
|
PlayerControlView controlView = binding.mediaVideo.findViewById(R.id.exo_controller);
|
||||||
resolution = controlView.findViewById(R.id.resolution);
|
TextView resolution = controlView.findViewById(R.id.resolution);
|
||||||
resolution.setText(String.format("%sp", res));
|
resolution.setText(String.format("%sp", res));
|
||||||
if (mode == Helper.VIDEO_MODE_NORMAL) {
|
if (mode == Helper.VIDEO_MODE_NORMAL) {
|
||||||
if (player != null)
|
if (player != null)
|
||||||
player.release();
|
player.release();
|
||||||
player = ExoPlayerFactory.newSimpleInstance(PeertubeActivity.this);
|
player = ExoPlayerFactory.newSimpleInstance(PeertubeActivity.this);
|
||||||
playerView.setPlayer(player);
|
binding.mediaVideo.setPlayer(player);
|
||||||
loader.setVisibility(View.GONE);
|
binding.loader.setVisibility(View.GONE);
|
||||||
int video_cache = sharedpreferences.getInt(Helper.SET_VIDEO_CACHE, Helper.DEFAULT_VIDEO_CACHE_MB);
|
int video_cache = sharedpreferences.getInt(Helper.SET_VIDEO_CACHE, Helper.DEFAULT_VIDEO_CACHE_MB);
|
||||||
ProgressiveMediaSource videoSource;
|
ProgressiveMediaSource videoSource;
|
||||||
if (video_cache == 0) {
|
if (video_cache == 0) {
|
||||||
@ -971,18 +1002,7 @@ public class PeertubeActivity extends AppCompatActivity implements CommentListAd
|
|||||||
builderSingle.show();
|
builderSingle.show();
|
||||||
}
|
}
|
||||||
|
|
||||||
@SuppressWarnings({"unused", "RedundantSuppression"})
|
|
||||||
public void manageVIewPostActions(RetrofitPeertubeAPI.ActionType statusAction, APIResponse apiResponse) {
|
|
||||||
|
|
||||||
if (peertube.isCommentsEnabled() && statusAction == ADD_COMMENT) {
|
|
||||||
CommentVM commentViewModel = new ViewModelProvider(PeertubeActivity.this).get(CommentVM.class);
|
|
||||||
commentViewModel.getThread(sepiaSearch?peertubeInstance:null, videoUuid, max_id).observe(PeertubeActivity.this, this::manageVIewComment);
|
|
||||||
} else if (statusAction == RetrofitPeertubeAPI.ActionType.REPORT_ACCOUNT) {
|
|
||||||
Toasty.success(PeertubeActivity.this, getString(R.string.successful_report), Toasty.LENGTH_LONG).show();
|
|
||||||
} else if (statusAction == RetrofitPeertubeAPI.ActionType.REPORT_VIDEO) {
|
|
||||||
Toasty.success(PeertubeActivity.this, getString(R.string.successful_video_report), Toasty.LENGTH_LONG).show();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void initFullscreenDialog() {
|
private void initFullscreenDialog() {
|
||||||
|
|
||||||
@ -998,18 +1018,116 @@ public class PeertubeActivity extends AppCompatActivity implements CommentListAd
|
|||||||
|
|
||||||
private void openFullscreenDialog() {
|
private void openFullscreenDialog() {
|
||||||
|
|
||||||
((ViewGroup) playerView.getParent()).removeView(playerView);
|
((ViewGroup) binding.mediaVideo.getParent()).removeView(binding.mediaVideo);
|
||||||
fullScreenDialog.addContentView(playerView, new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT));
|
fullScreenDialog.addContentView(binding.mediaVideo, new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT));
|
||||||
fullScreenIcon.setImageDrawable(ContextCompat.getDrawable(PeertubeActivity.this, R.drawable.ic_baseline_fullscreen_exit_24));
|
fullScreenIcon.setImageDrawable(ContextCompat.getDrawable(PeertubeActivity.this, R.drawable.ic_baseline_fullscreen_exit_24));
|
||||||
fullScreenMode = true;
|
fullScreenMode = true;
|
||||||
|
|
||||||
fullScreenDialog.show();
|
fullScreenDialog.show();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void openCommentThread(Comment comment, int position){
|
||||||
|
|
||||||
|
|
||||||
|
CommentVM commentViewModel = new ViewModelProvider(PeertubeActivity.this).get(CommentVM.class);
|
||||||
|
binding.peertubeReply.setVisibility(View.GONE);
|
||||||
|
commentViewModel.getRepliesComment(videoUuid, comment.getId()).observe(PeertubeActivity.this, this::manageVIewCommentReply);
|
||||||
|
|
||||||
|
Account account = comment.getAccount();
|
||||||
|
Helper.loadGiF(PeertubeActivity.this, account.getAvatar() != null ? account.getAvatar().getPath() : null, binding.commentAccountProfile);
|
||||||
|
binding.commentAccountDisplayname.setText(account.getDisplayName());
|
||||||
|
binding.commentAccountUsername.setText(account.getAcct());
|
||||||
|
Spanned commentSpan;
|
||||||
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N)
|
||||||
|
commentSpan = Html.fromHtml(comment.getText(), Html.FROM_HTML_MODE_COMPACT);
|
||||||
|
else
|
||||||
|
commentSpan = Html.fromHtml(comment.getText());
|
||||||
|
binding.commentContent.setText(commentSpan);
|
||||||
|
binding.commentDate.setText(Helper.dateDiff(PeertubeActivity.this, comment.getCreatedAt()));
|
||||||
|
binding.replyThread.setVisibility(View.VISIBLE);
|
||||||
|
TranslateAnimation animate = new TranslateAnimation(
|
||||||
|
binding.peertubeInformationContainer.getWidth(),
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0);
|
||||||
|
animate.setAnimationListener(new Animation.AnimationListener() {
|
||||||
|
@Override
|
||||||
|
public void onAnimationStart(Animation animation) {}
|
||||||
|
@Override
|
||||||
|
public void onAnimationEnd(Animation animation) {
|
||||||
|
binding.peertubeInformationContainer.setVisibility(View.GONE);
|
||||||
|
}
|
||||||
|
@Override
|
||||||
|
public void onAnimationRepeat(Animation animation) {}
|
||||||
|
});
|
||||||
|
animate.setDuration(500);
|
||||||
|
binding.addCommentWriteReply.setText(String.format("@%s ", comment.getAccount().getAcct()));
|
||||||
|
binding.addCommentWriteReply.setSelection(binding.addCommentWriteReply.getText().length());
|
||||||
|
binding.replyThread.startAnimation(animate);
|
||||||
|
binding.sendReply.setOnClickListener(null);
|
||||||
|
binding.sendReply.setOnClickListener(v -> {
|
||||||
|
if (isLoggedIn(PeertubeActivity.this) && !sepiaSearch) {
|
||||||
|
String commentView = binding.addCommentWriteReply.getText().toString();
|
||||||
|
if (commentView.trim().length() > 0) {
|
||||||
|
PostActionsVM viewModelComment = new ViewModelProvider(PeertubeActivity.this).get(PostActionsVM.class);
|
||||||
|
viewModelComment.comment(REPLY, peertube.getId(), comment.getId(), commentView).observe(PeertubeActivity.this, apiResponse1 -> manageVIewPostActions(REPLY, position, apiResponse1));
|
||||||
|
binding.addCommentWriteReply.setText("");
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if( sepiaSearch) {
|
||||||
|
Toasty.info(PeertubeActivity.this, getString(R.string.federation_issue), Toasty.LENGTH_SHORT).show();
|
||||||
|
}else {
|
||||||
|
Toasty.error(PeertubeActivity.this, getString(R.string.not_logged_in), Toast.LENGTH_SHORT).show();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
private void closeCommentThread(){
|
||||||
|
binding.peertubeInformationContainer.setVisibility(View.VISIBLE);
|
||||||
|
TranslateAnimation animate = new TranslateAnimation(
|
||||||
|
0,
|
||||||
|
binding.replyThread.getWidth(),
|
||||||
|
0,
|
||||||
|
0);
|
||||||
|
animate.setAnimationListener(new Animation.AnimationListener() {
|
||||||
|
@Override
|
||||||
|
public void onAnimationStart(Animation animation) {}
|
||||||
|
@Override
|
||||||
|
public void onAnimationEnd(Animation animation) {
|
||||||
|
binding.replyThread.setVisibility(View.GONE);
|
||||||
|
}
|
||||||
|
@Override
|
||||||
|
public void onAnimationRepeat(Animation animation) {}
|
||||||
|
});
|
||||||
|
animate.setDuration(500);
|
||||||
|
binding.replyThread.startAnimation(animate);
|
||||||
|
}
|
||||||
|
|
||||||
|
@SuppressWarnings({"unused", "RedundantSuppression"})
|
||||||
|
public void manageVIewPostActions(RetrofitPeertubeAPI.ActionType statusAction, int position, APIResponse apiResponse) {
|
||||||
|
|
||||||
|
if (peertube.isCommentsEnabled() && statusAction == ADD_COMMENT) {
|
||||||
|
if( apiResponse.getComments() != null && apiResponse.getComments().size() > 0 ) {
|
||||||
|
comments.add(0, apiResponse.getComments().get(0));
|
||||||
|
commentListAdapter.notifyItemInserted(0);
|
||||||
|
}
|
||||||
|
} else if (peertube.isCommentsEnabled() && statusAction == REPLY) {
|
||||||
|
if( apiResponse.getComments() != null && apiResponse.getComments().size() > 0 ) {
|
||||||
|
commentsThread.add(position, apiResponse.getComments().get(0));
|
||||||
|
commentReplyListAdapter.notifyItemInserted(position);
|
||||||
|
}
|
||||||
|
} else if (statusAction == RetrofitPeertubeAPI.ActionType.REPORT_ACCOUNT) {
|
||||||
|
Toasty.success(PeertubeActivity.this, getString(R.string.successful_report), Toasty.LENGTH_LONG).show();
|
||||||
|
} else if (statusAction == RetrofitPeertubeAPI.ActionType.REPORT_VIDEO) {
|
||||||
|
Toasty.success(PeertubeActivity.this, getString(R.string.successful_video_report), Toasty.LENGTH_LONG).show();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private void closeFullscreenDialog() {
|
private void closeFullscreenDialog() {
|
||||||
|
|
||||||
((ViewGroup) playerView.getParent()).removeView(playerView);
|
((ViewGroup) binding.mediaVideo.getParent()).removeView(binding.mediaVideo);
|
||||||
((FrameLayout) findViewById(R.id.main_media_frame)).addView(playerView);
|
((FrameLayout) findViewById(R.id.main_media_frame)).addView(binding.mediaVideo);
|
||||||
fullScreenMode = false;
|
fullScreenMode = false;
|
||||||
fullScreenDialog.dismiss();
|
fullScreenDialog.dismiss();
|
||||||
fullScreenIcon.setImageDrawable(ContextCompat.getDrawable(PeertubeActivity.this, R.drawable.ic_baseline_fullscreen_24));
|
fullScreenIcon.setImageDrawable(ContextCompat.getDrawable(PeertubeActivity.this, R.drawable.ic_baseline_fullscreen_24));
|
||||||
@ -1017,7 +1135,7 @@ public class PeertubeActivity extends AppCompatActivity implements CommentListAd
|
|||||||
|
|
||||||
private void initFullscreenButton() {
|
private void initFullscreenButton() {
|
||||||
|
|
||||||
PlayerControlView controlView = playerView.findViewById(R.id.exo_controller);
|
PlayerControlView controlView = binding.mediaVideo.findViewById(R.id.exo_controller);
|
||||||
fullScreenIcon = controlView.findViewById(R.id.exo_fullscreen_icon);
|
fullScreenIcon = controlView.findViewById(R.id.exo_fullscreen_icon);
|
||||||
View fullScreenButton = controlView.findViewById(R.id.exo_fullscreen_button);
|
View fullScreenButton = controlView.findViewById(R.id.exo_fullscreen_button);
|
||||||
fullScreenButton.setOnClickListener(v -> {
|
fullScreenButton.setOnClickListener(v -> {
|
||||||
@ -1035,8 +1153,8 @@ public class PeertubeActivity extends AppCompatActivity implements CommentListAd
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void initResolution() {
|
private void initResolution() {
|
||||||
PlayerControlView controlView = playerView.findViewById(R.id.exo_controller);
|
PlayerControlView controlView = binding.mediaVideo.findViewById(R.id.exo_controller);
|
||||||
resolution = controlView.findViewById(R.id.resolution);
|
TextView resolution = controlView.findViewById(R.id.resolution);
|
||||||
if (peertube.getFiles() != null && peertube.getFiles().size() > 0) {
|
if (peertube.getFiles() != null && peertube.getFiles().size() > 0) {
|
||||||
resolution.setText(String.format("%s", Helper.defaultFile(PeertubeActivity.this, peertube.getFiles()).getResolutions().getLabel()));
|
resolution.setText(String.format("%s", Helper.defaultFile(PeertubeActivity.this, peertube.getFiles()).getResolutions().getLabel()));
|
||||||
resolution.setOnClickListener(v -> displayResolution());
|
resolution.setOnClickListener(v -> displayResolution());
|
||||||
@ -1070,8 +1188,8 @@ public class PeertubeActivity extends AppCompatActivity implements CommentListAd
|
|||||||
DrawableCompat.setTint(thumbDown, getResources().getColor(R.color.negative_thumbs));
|
DrawableCompat.setTint(thumbDown, getResources().getColor(R.color.negative_thumbs));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
peertube_like_count.setCompoundDrawablesWithIntrinsicBounds(null, thumbUp, null, null);
|
binding.peertubeLikeCount.setCompoundDrawablesWithIntrinsicBounds(null, thumbUp, null, null);
|
||||||
peertube_dislike_count.setCompoundDrawablesWithIntrinsicBounds(null, thumbDown, null, null);
|
binding.peertubeDislikeCount.setCompoundDrawablesWithIntrinsicBounds(null, thumbDown, null, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void manageVIewPlaylists(APIResponse apiResponse) {
|
public void manageVIewPlaylists(APIResponse apiResponse) {
|
||||||
@ -1157,6 +1275,6 @@ public class PeertubeActivity extends AppCompatActivity implements CommentListAd
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onAllCommentRemoved() {
|
public void onAllCommentRemoved() {
|
||||||
no_action_text.setVisibility(View.VISIBLE);
|
binding.noActionText.setVisibility(View.VISIBLE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -145,10 +145,12 @@ public class PeertubeRegisterActivity extends AppCompatActivity {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
String[] emailArray = email.getText().toString().split("@");
|
String[] emailArray = email.getText().toString().split("@");
|
||||||
|
if (!BuildConfig.full_instances) {
|
||||||
if (emailArray.length > 1 && !Arrays.asList(Helper.valideEmails).contains(emailArray[1])) {
|
if (emailArray.length > 1 && !Arrays.asList(Helper.valideEmails).contains(emailArray[1])) {
|
||||||
Toasty.error(PeertubeRegisterActivity.this, getString(R.string.email_error_domain, emailArray[1])).show();
|
Toasty.error(PeertubeRegisterActivity.this, getString(R.string.email_error_domain, emailArray[1])).show();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (password.getText().toString().trim().length() < 8) {
|
if (password.getText().toString().trim().length() < 8) {
|
||||||
Toasty.error(PeertubeRegisterActivity.this, getString(R.string.password_too_short)).show();
|
Toasty.error(PeertubeRegisterActivity.this, getString(R.string.password_too_short)).show();
|
||||||
|
@ -87,44 +87,36 @@ public class SepiaSearchActivity extends AppCompatActivity {
|
|||||||
});
|
});
|
||||||
|
|
||||||
RadioGroup sepia_element_nsfw = findViewById(R.id.sepia_element_nsfw);
|
RadioGroup sepia_element_nsfw = findViewById(R.id.sepia_element_nsfw);
|
||||||
sepia_element_nsfw.setOnCheckedChangeListener((group, checkedId) -> {
|
sepia_element_nsfw.setOnCheckedChangeListener((group, checkedId) -> sepiaSearchVideo.setNsfw(checkedId != R.id.sepia_element_nsfw_no));
|
||||||
if (checkedId == R.id.sepia_element_nsfw_no) {
|
|
||||||
sepiaSearchVideo.setNsfw(false);
|
|
||||||
} else {
|
|
||||||
sepiaSearchVideo.setNsfw(true);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
RadioGroup radio_date = findViewById(R.id.radio_date);
|
RadioGroup radio_date = findViewById(R.id.radio_date);
|
||||||
radio_date.setOnCheckedChangeListener((group, checkedId) -> {
|
radio_date.setOnCheckedChangeListener((group, checkedId) -> {
|
||||||
switch(checkedId){
|
if (checkedId == R.id.sepia_element_published_date_today) {
|
||||||
case R.id.sepia_element_published_date_today:
|
|
||||||
Calendar cal = GregorianCalendar.getInstance();
|
Calendar cal = GregorianCalendar.getInstance();
|
||||||
cal.set(Calendar.HOUR_OF_DAY, 0);
|
cal.set(Calendar.HOUR_OF_DAY, 0);
|
||||||
cal.set(Calendar.MINUTE, 0);
|
cal.set(Calendar.MINUTE, 0);
|
||||||
cal.set(Calendar.SECOND, 0);
|
cal.set(Calendar.SECOND, 0);
|
||||||
cal.set(Calendar.MILLISECOND, 0);
|
cal.set(Calendar.MILLISECOND, 0);
|
||||||
sepiaSearchVideo.setStartDate(cal.getTime());
|
sepiaSearchVideo.setStartDate(cal.getTime());
|
||||||
break;
|
} else if (checkedId == R.id.sepia_element_published_date_last_7_days) {
|
||||||
case R.id.sepia_element_published_date_last_7_days:
|
Calendar cal;
|
||||||
cal = GregorianCalendar.getInstance();
|
cal = GregorianCalendar.getInstance();
|
||||||
cal.setTime(new Date());
|
cal.setTime(new Date());
|
||||||
cal.add(Calendar.DAY_OF_YEAR, -7);
|
cal.add(Calendar.DAY_OF_YEAR, -7);
|
||||||
sepiaSearchVideo.setStartDate(cal.getTime());
|
sepiaSearchVideo.setStartDate(cal.getTime());
|
||||||
break;
|
} else if (checkedId == R.id.sepia_element_published_date_last_30_days) {
|
||||||
case R.id.sepia_element_published_date_last_30_days:
|
Calendar cal;
|
||||||
cal = GregorianCalendar.getInstance();
|
cal = GregorianCalendar.getInstance();
|
||||||
cal.setTime(new Date());
|
cal.setTime(new Date());
|
||||||
cal.add(Calendar.DAY_OF_YEAR, -30);
|
cal.add(Calendar.DAY_OF_YEAR, -30);
|
||||||
sepiaSearchVideo.setStartDate(cal.getTime());
|
sepiaSearchVideo.setStartDate(cal.getTime());
|
||||||
break;
|
} else if (checkedId == R.id.sepia_element_published_date_last_365_days) {
|
||||||
case R.id.sepia_element_published_date_last_365_days:
|
Calendar cal;
|
||||||
cal = GregorianCalendar.getInstance();
|
cal = GregorianCalendar.getInstance();
|
||||||
cal.setTime(new Date());
|
cal.setTime(new Date());
|
||||||
cal.add(Calendar.DAY_OF_YEAR, -365);
|
cal.add(Calendar.DAY_OF_YEAR, -365);
|
||||||
sepiaSearchVideo.setStartDate(cal.getTime());
|
sepiaSearchVideo.setStartDate(cal.getTime());
|
||||||
break;
|
} else {
|
||||||
default:
|
|
||||||
sepiaSearchVideo.setStartDate(null);
|
sepiaSearchVideo.setStartDate(null);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@ -132,23 +124,18 @@ public class SepiaSearchActivity extends AppCompatActivity {
|
|||||||
|
|
||||||
RadioGroup duration = findViewById(R.id.duration);
|
RadioGroup duration = findViewById(R.id.duration);
|
||||||
duration.setOnCheckedChangeListener((group, checkedId) -> {
|
duration.setOnCheckedChangeListener((group, checkedId) -> {
|
||||||
switch(checkedId){
|
if (checkedId == R.id.sepia_element_duration_short) {
|
||||||
case R.id.sepia_element_duration_short:
|
|
||||||
sepiaSearchVideo.setDurationMin(0);
|
sepiaSearchVideo.setDurationMin(0);
|
||||||
sepiaSearchVideo.setDurationMax(240);
|
sepiaSearchVideo.setDurationMax(240);
|
||||||
break;
|
} else if (checkedId == R.id.sepia_element_duration_medium) {
|
||||||
case R.id.sepia_element_duration_medium:
|
|
||||||
sepiaSearchVideo.setDurationMin(240);
|
sepiaSearchVideo.setDurationMin(240);
|
||||||
sepiaSearchVideo.setDurationMax(600);
|
sepiaSearchVideo.setDurationMax(600);
|
||||||
break;
|
} else if (checkedId == R.id.sepia_element_duration_long) {
|
||||||
case R.id.sepia_element_duration_long:
|
|
||||||
sepiaSearchVideo.setDurationMin(600);
|
sepiaSearchVideo.setDurationMin(600);
|
||||||
sepiaSearchVideo.setDurationMax(999999999);
|
sepiaSearchVideo.setDurationMax(999999999);
|
||||||
break;
|
} else {
|
||||||
default:
|
|
||||||
sepiaSearchVideo.setDurationMin(0);
|
sepiaSearchVideo.setDurationMin(0);
|
||||||
sepiaSearchVideo.setDurationMax(999999999);
|
sepiaSearchVideo.setDurationMax(999999999);
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -14,9 +14,6 @@ package app.fedilab.fedilabtube;
|
|||||||
* You should have received a copy of the GNU General Public License along with TubeLab; if not,
|
* You should have received a copy of the GNU General Public License along with TubeLab; if not,
|
||||||
* see <http://www.gnu.org/licenses>. */
|
* see <http://www.gnu.org/licenses>. */
|
||||||
|
|
||||||
import android.content.Intent;
|
|
||||||
import android.content.SharedPreferences;
|
|
||||||
import android.content.res.ColorStateList;
|
|
||||||
import android.os.Build;
|
import android.os.Build;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.text.Html;
|
import android.text.Html;
|
||||||
@ -26,8 +23,6 @@ import android.view.LayoutInflater;
|
|||||||
import android.view.Menu;
|
import android.view.Menu;
|
||||||
import android.view.MenuItem;
|
import android.view.MenuItem;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.view.ViewGroup;
|
|
||||||
import android.widget.Button;
|
|
||||||
import android.widget.EditText;
|
import android.widget.EditText;
|
||||||
import android.widget.ImageView;
|
import android.widget.ImageView;
|
||||||
import android.widget.LinearLayout;
|
import android.widget.LinearLayout;
|
||||||
@ -36,7 +31,6 @@ import android.widget.Toast;
|
|||||||
|
|
||||||
import androidx.appcompat.app.AlertDialog;
|
import androidx.appcompat.app.AlertDialog;
|
||||||
import androidx.appcompat.app.AppCompatActivity;
|
import androidx.appcompat.app.AppCompatActivity;
|
||||||
import androidx.core.content.ContextCompat;
|
|
||||||
import androidx.fragment.app.Fragment;
|
import androidx.fragment.app.Fragment;
|
||||||
import androidx.fragment.app.FragmentManager;
|
import androidx.fragment.app.FragmentManager;
|
||||||
import androidx.fragment.app.FragmentStatePagerAdapter;
|
import androidx.fragment.app.FragmentStatePagerAdapter;
|
||||||
@ -48,45 +42,34 @@ import com.google.android.material.tabs.TabLayout;
|
|||||||
|
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.Map;
|
|
||||||
|
|
||||||
import app.fedilab.fedilabtube.client.APIResponse;
|
import app.fedilab.fedilabtube.client.APIResponse;
|
||||||
import app.fedilab.fedilabtube.client.RetrofitPeertubeAPI;
|
import app.fedilab.fedilabtube.client.RetrofitPeertubeAPI;
|
||||||
import app.fedilab.fedilabtube.client.data.ChannelData.Channel;
|
import app.fedilab.fedilabtube.client.data.AccountData;
|
||||||
import app.fedilab.fedilabtube.fragment.DisplayAccountsFragment;
|
import app.fedilab.fedilabtube.fragment.DisplayAccountsFragment;
|
||||||
|
import app.fedilab.fedilabtube.fragment.DisplayChannelsFragment;
|
||||||
import app.fedilab.fedilabtube.fragment.DisplayVideosFragment;
|
import app.fedilab.fedilabtube.fragment.DisplayVideosFragment;
|
||||||
import app.fedilab.fedilabtube.helper.Helper;
|
import app.fedilab.fedilabtube.helper.Helper;
|
||||||
import app.fedilab.fedilabtube.viewmodel.ChannelsVM;
|
import app.fedilab.fedilabtube.viewmodel.AccountsVM;
|
||||||
import app.fedilab.fedilabtube.viewmodel.PostActionsVM;
|
import app.fedilab.fedilabtube.viewmodel.PostActionsVM;
|
||||||
import app.fedilab.fedilabtube.viewmodel.RelationshipVM;
|
|
||||||
import app.fedilab.fedilabtube.viewmodel.TimelineVM;
|
import app.fedilab.fedilabtube.viewmodel.TimelineVM;
|
||||||
import es.dmoral.toasty.Toasty;
|
import es.dmoral.toasty.Toasty;
|
||||||
|
|
||||||
import static androidx.core.text.HtmlCompat.FROM_HTML_MODE_LEGACY;
|
import static androidx.core.text.HtmlCompat.FROM_HTML_MODE_LEGACY;
|
||||||
import static app.fedilab.fedilabtube.client.RetrofitPeertubeAPI.ActionType.FOLLOW;
|
|
||||||
import static app.fedilab.fedilabtube.client.RetrofitPeertubeAPI.ActionType.MUTE;
|
import static app.fedilab.fedilabtube.client.RetrofitPeertubeAPI.ActionType.MUTE;
|
||||||
import static app.fedilab.fedilabtube.client.RetrofitPeertubeAPI.ActionType.REPORT_ACCOUNT;
|
import static app.fedilab.fedilabtube.client.RetrofitPeertubeAPI.ActionType.REPORT_ACCOUNT;
|
||||||
import static app.fedilab.fedilabtube.client.RetrofitPeertubeAPI.ActionType.UNFOLLOW;
|
|
||||||
import static app.fedilab.fedilabtube.client.RetrofitPeertubeAPI.DataType.CHANNEL;
|
|
||||||
import static app.fedilab.fedilabtube.helper.Helper.getLiveInstance;
|
|
||||||
import static app.fedilab.fedilabtube.helper.Helper.isLoggedIn;
|
|
||||||
|
|
||||||
|
|
||||||
public class ShowAccountActivity extends AppCompatActivity {
|
public class ShowAccountActivity extends AppCompatActivity {
|
||||||
|
|
||||||
|
|
||||||
private Button account_follow;
|
|
||||||
private ViewPager mPager;
|
private ViewPager mPager;
|
||||||
private TabLayout tabLayout;
|
private TabLayout tabLayout;
|
||||||
private TextView account_note, subscriber_count;
|
private TextView account_note, subscriber_count;
|
||||||
private Map<String, Boolean> relationship;
|
|
||||||
private ImageView account_pp;
|
private ImageView account_pp;
|
||||||
private TextView account_dn;
|
private TextView account_dn;
|
||||||
private Channel channel;
|
private AccountData.Account account;
|
||||||
private action doAction;
|
private String accountAcct;
|
||||||
private String channelAcct;
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onCreate(Bundle savedInstanceState) {
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
@ -94,15 +77,13 @@ public class ShowAccountActivity extends AppCompatActivity {
|
|||||||
setContentView(R.layout.activity_show_account);
|
setContentView(R.layout.activity_show_account);
|
||||||
setTitle("");
|
setTitle("");
|
||||||
Bundle b = getIntent().getExtras();
|
Bundle b = getIntent().getExtras();
|
||||||
account_follow = findViewById(R.id.account_follow);
|
|
||||||
subscriber_count = findViewById(R.id.subscriber_count);
|
subscriber_count = findViewById(R.id.subscriber_count);
|
||||||
account_follow.setEnabled(false);
|
|
||||||
account_pp = findViewById(R.id.account_pp);
|
account_pp = findViewById(R.id.account_pp);
|
||||||
account_dn = findViewById(R.id.account_dn);
|
account_dn = findViewById(R.id.account_dn);
|
||||||
account_pp.setBackgroundResource(R.drawable.account_pp_border);
|
account_pp.setBackgroundResource(R.drawable.account_pp_border);
|
||||||
if (b != null) {
|
if (b != null) {
|
||||||
channel = b.getParcelable("channel");
|
account = b.getParcelable("account");
|
||||||
channelAcct = b.getString("channelId");
|
accountAcct = b.getString("accountAcct");
|
||||||
} else {
|
} else {
|
||||||
Toasty.error(ShowAccountActivity.this, getString(R.string.toast_error_loading_account), Toast.LENGTH_LONG).show();
|
Toasty.error(ShowAccountActivity.this, getString(R.string.toast_error_loading_account), Toast.LENGTH_LONG).show();
|
||||||
}
|
}
|
||||||
@ -114,11 +95,9 @@ public class ShowAccountActivity extends AppCompatActivity {
|
|||||||
tabLayout = findViewById(R.id.account_tabLayout);
|
tabLayout = findViewById(R.id.account_tabLayout);
|
||||||
account_note = findViewById(R.id.account_note);
|
account_note = findViewById(R.id.account_note);
|
||||||
|
|
||||||
|
manageAccount();
|
||||||
ChannelsVM viewModel = new ViewModelProvider(ShowAccountActivity.this).get(ChannelsVM.class);
|
AccountsVM viewModel = new ViewModelProvider(ShowAccountActivity.this).get(AccountsVM.class);
|
||||||
|
viewModel.getAccount(accountAcct == null ? account.getUsername() + "@" + account.getHost() : accountAcct).observe(ShowAccountActivity.this, this::manageViewAccounts);
|
||||||
manageChannel();
|
|
||||||
viewModel.get(CHANNEL, channelAcct == null ? channel.getName() + "@" + channel.getHost() : channelAcct).observe(ShowAccountActivity.this, this::manageViewAccounts);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -137,7 +116,7 @@ public class ShowAccountActivity extends AppCompatActivity {
|
|||||||
return true;
|
return true;
|
||||||
} else if (item.getItemId() == R.id.action_mute) {
|
} else if (item.getItemId() == R.id.action_mute) {
|
||||||
PostActionsVM viewModel = new ViewModelProvider(ShowAccountActivity.this).get(PostActionsVM.class);
|
PostActionsVM viewModel = new ViewModelProvider(ShowAccountActivity.this).get(PostActionsVM.class);
|
||||||
viewModel.post(MUTE, channel.getOwnerAccount() != null ? channel.getOwnerAccount().getAcct() : channel.getAcct(), null).observe(ShowAccountActivity.this, apiResponse -> manageVIewPostActions(MUTE, apiResponse));
|
viewModel.post(MUTE, accountAcct == null ? account.getUsername() + "@" + account.getHost() : accountAcct, null).observe(ShowAccountActivity.this, apiResponse -> manageVIewPostActions(MUTE, apiResponse));
|
||||||
} else if (item.getItemId() == R.id.action_report) {
|
} else if (item.getItemId() == R.id.action_report) {
|
||||||
AlertDialog.Builder dialogBuilder = new AlertDialog.Builder(ShowAccountActivity.this);
|
AlertDialog.Builder dialogBuilder = new AlertDialog.Builder(ShowAccountActivity.this);
|
||||||
LayoutInflater inflater1 = getLayoutInflater();
|
LayoutInflater inflater1 = getLayoutInflater();
|
||||||
@ -150,7 +129,7 @@ public class ShowAccountActivity extends AppCompatActivity {
|
|||||||
Toasty.info(ShowAccountActivity.this, getString(R.string.report_comment_size), Toasty.LENGTH_LONG).show();
|
Toasty.info(ShowAccountActivity.this, getString(R.string.report_comment_size), Toasty.LENGTH_LONG).show();
|
||||||
} else {
|
} else {
|
||||||
PostActionsVM viewModel = new ViewModelProvider(ShowAccountActivity.this).get(PostActionsVM.class);
|
PostActionsVM viewModel = new ViewModelProvider(ShowAccountActivity.this).get(PostActionsVM.class);
|
||||||
viewModel.post(REPORT_ACCOUNT, channel.getId(), report_content.getText().toString()).observe(ShowAccountActivity.this, apiResponse -> manageVIewPostActions(REPORT_ACCOUNT, apiResponse));
|
viewModel.post(REPORT_ACCOUNT, account.getId(), report_content.getText().toString()).observe(ShowAccountActivity.this, apiResponse -> manageVIewPostActions(REPORT_ACCOUNT, apiResponse));
|
||||||
dialog.dismiss();
|
dialog.dismiss();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@ -160,30 +139,18 @@ public class ShowAccountActivity extends AppCompatActivity {
|
|||||||
return super.onOptionsItemSelected(item);
|
return super.onOptionsItemSelected(item);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void manageChannel() {
|
private void manageAccount() {
|
||||||
SharedPreferences sharedpreferences = getSharedPreferences(Helper.APP_PREFS, MODE_PRIVATE);
|
|
||||||
|
|
||||||
String accountIdRelation = channel.getAcct();
|
|
||||||
if (isLoggedIn(ShowAccountActivity.this)) {
|
|
||||||
RelationshipVM viewModel = new ViewModelProvider(ShowAccountActivity.this).get(RelationshipVM.class);
|
|
||||||
List<String> uids = new ArrayList<>();
|
|
||||||
uids.add(accountIdRelation);
|
|
||||||
viewModel.get(uids).observe(ShowAccountActivity.this, this::manageVIewRelationship);
|
|
||||||
}
|
|
||||||
|
|
||||||
setTitle(channel.getAcct());
|
|
||||||
|
|
||||||
|
setTitle(account.getAcct());
|
||||||
|
|
||||||
mPager = findViewById(R.id.account_viewpager);
|
mPager = findViewById(R.id.account_viewpager);
|
||||||
|
tabLayout.addTab(tabLayout.newTab().setText(getString(R.string.channels)));
|
||||||
tabLayout.addTab(tabLayout.newTab().setText(getString(R.string.videos)));
|
tabLayout.addTab(tabLayout.newTab().setText(getString(R.string.videos)));
|
||||||
mPager.setOffscreenPageLimit(1);
|
mPager.setOffscreenPageLimit(2);
|
||||||
|
|
||||||
|
|
||||||
PagerAdapter mPagerAdapter = new ScreenSlidePagerAdapter(getSupportFragmentManager());
|
PagerAdapter mPagerAdapter = new ScreenSlidePagerAdapter(getSupportFragmentManager());
|
||||||
mPager.setAdapter(mPagerAdapter);
|
mPager.setAdapter(mPagerAdapter);
|
||||||
ViewGroup.LayoutParams params = tabLayout.getLayoutParams();
|
|
||||||
params.height = 0;
|
|
||||||
tabLayout.setLayoutParams(params);
|
|
||||||
mPager.addOnPageChangeListener(new ViewPager.OnPageChangeListener() {
|
mPager.addOnPageChangeListener(new ViewPager.OnPageChangeListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onPageScrolled(int position, float positionOffset, int positionOffsetPixels) {
|
public void onPageScrolled(int position, float positionOffset, int positionOffsetPixels) {
|
||||||
@ -222,112 +189,26 @@ public class ShowAccountActivity extends AppCompatActivity {
|
|||||||
switch (tab.getPosition()) {
|
switch (tab.getPosition()) {
|
||||||
case 0:
|
case 0:
|
||||||
if (fragment != null) {
|
if (fragment != null) {
|
||||||
DisplayVideosFragment displayVideosFragment = ((DisplayVideosFragment) fragment);
|
DisplayChannelsFragment displayChannelsFragment = ((DisplayChannelsFragment) fragment);
|
||||||
displayVideosFragment.scrollToTop();
|
displayChannelsFragment.scrollToTop();
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 1:
|
case 1:
|
||||||
if (fragment != null) {
|
if (fragment != null) {
|
||||||
DisplayAccountsFragment displayAccountsFragment = ((DisplayAccountsFragment) fragment);
|
DisplayVideosFragment displayVideosFragment = ((DisplayVideosFragment) fragment);
|
||||||
displayAccountsFragment.scrollToTop();
|
displayVideosFragment.scrollToTop();
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
account_dn.setText(channel.getDisplayName());
|
account_dn.setText(account.getDisplayName());
|
||||||
|
|
||||||
|
manageNotes(account);
|
||||||
manageNotes(channel);
|
Helper.loadGiF(ShowAccountActivity.this, account.getAvatar() != null ? account.getAvatar().getPath() : null, account_pp);
|
||||||
Helper.loadGiF(ShowAccountActivity.this, channel.getAvatar() != null ? channel.getAvatar().getPath() : null, account_pp);
|
|
||||||
//Follow button
|
|
||||||
String target = channel.getAcct();
|
|
||||||
|
|
||||||
account_follow.setOnClickListener(v -> {
|
|
||||||
if (doAction == action.NOTHING) {
|
|
||||||
Toasty.info(ShowAccountActivity.this, getString(R.string.nothing_to_do), Toast.LENGTH_LONG).show();
|
|
||||||
} else if (doAction == action.FOLLOW) {
|
|
||||||
account_follow.setEnabled(false);
|
|
||||||
PostActionsVM viewModel = new ViewModelProvider(ShowAccountActivity.this).get(PostActionsVM.class);
|
|
||||||
viewModel.post(FOLLOW, target, null).observe(ShowAccountActivity.this, apiResponse -> manageVIewPostActions(FOLLOW, apiResponse));
|
|
||||||
} else if (doAction == action.UNFOLLOW) {
|
|
||||||
boolean confirm_unfollow = sharedpreferences.getBoolean(Helper.SET_UNFOLLOW_VALIDATION, true);
|
|
||||||
if (confirm_unfollow) {
|
|
||||||
AlertDialog.Builder unfollowConfirm = new AlertDialog.Builder(ShowAccountActivity.this);
|
|
||||||
unfollowConfirm.setTitle(getString(R.string.unfollow_confirm));
|
|
||||||
unfollowConfirm.setMessage(channel.getAcct());
|
|
||||||
unfollowConfirm.setNegativeButton(R.string.cancel, (dialog, which) -> dialog.dismiss());
|
|
||||||
unfollowConfirm.setPositiveButton(R.string.yes, (dialog, which) -> {
|
|
||||||
account_follow.setEnabled(false);
|
|
||||||
PostActionsVM viewModel = new ViewModelProvider(ShowAccountActivity.this).get(PostActionsVM.class);
|
|
||||||
viewModel.post(UNFOLLOW, target, null).observe(ShowAccountActivity.this, apiResponse -> manageVIewPostActions(UNFOLLOW, apiResponse));
|
|
||||||
dialog.dismiss();
|
|
||||||
});
|
|
||||||
unfollowConfirm.show();
|
|
||||||
} else {
|
|
||||||
account_follow.setEnabled(false);
|
|
||||||
PostActionsVM viewModel = new ViewModelProvider(ShowAccountActivity.this).get(PostActionsVM.class);
|
|
||||||
viewModel.post(UNFOLLOW, target, null).observe(ShowAccountActivity.this, apiResponse -> manageVIewPostActions(UNFOLLOW, apiResponse));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
public void manageVIewRelationship(APIResponse apiResponse) {
|
|
||||||
|
|
||||||
if (apiResponse.getError() != null) {
|
|
||||||
Toasty.error(ShowAccountActivity.this, apiResponse.getError().getError(), Toast.LENGTH_LONG).show();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
this.relationship = apiResponse.getRelationships();
|
|
||||||
manageButtonVisibility();
|
|
||||||
|
|
||||||
invalidateOptionsMenu();
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
//Manages the visibility of the button
|
|
||||||
private void manageButtonVisibility() {
|
|
||||||
if (relationship == null)
|
|
||||||
return;
|
|
||||||
|
|
||||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
|
|
||||||
int[][] states = new int[][]{
|
|
||||||
new int[]{android.R.attr.state_enabled}, // enabled
|
|
||||||
new int[]{-android.R.attr.state_enabled}, // disabled
|
|
||||||
new int[]{-android.R.attr.state_checked}, // unchecked
|
|
||||||
new int[]{android.R.attr.state_pressed} // pressed
|
|
||||||
};
|
|
||||||
|
|
||||||
int[] colors = new int[]{
|
|
||||||
ContextCompat.getColor(ShowAccountActivity.this, Helper.getColorAccent()),
|
|
||||||
ContextCompat.getColor(ShowAccountActivity.this, Helper.getColorAccent()),
|
|
||||||
ContextCompat.getColor(ShowAccountActivity.this, Helper.getColorAccent()),
|
|
||||||
ContextCompat.getColor(ShowAccountActivity.this, Helper.getColorAccent())
|
|
||||||
};
|
|
||||||
account_follow.setBackgroundTintList(new ColorStateList(states, colors));
|
|
||||||
}
|
|
||||||
account_follow.setEnabled(true);
|
|
||||||
|
|
||||||
boolean isFollowing = relationship.get(channel.getAcct());
|
|
||||||
if (isFollowing) {
|
|
||||||
account_follow.setText(R.string.action_unfollow);
|
|
||||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
|
|
||||||
account_follow.setBackgroundTintList(ColorStateList.valueOf(ContextCompat.getColor(ShowAccountActivity.this, R.color.red_1)));
|
|
||||||
}
|
|
||||||
doAction = action.UNFOLLOW;
|
|
||||||
account_follow.setVisibility(View.VISIBLE);
|
|
||||||
} else {
|
|
||||||
account_follow.setText(R.string.action_follow);
|
|
||||||
doAction = action.FOLLOW;
|
|
||||||
account_follow.setVisibility(View.VISIBLE);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onDestroy() {
|
public void onDestroy() {
|
||||||
super.onDestroy();
|
super.onDestroy();
|
||||||
@ -345,47 +226,31 @@ public class ShowAccountActivity extends AppCompatActivity {
|
|||||||
Toasty.error(ShowAccountActivity.this, apiResponse.getError().getError(), Toast.LENGTH_LONG).show();
|
Toasty.error(ShowAccountActivity.this, apiResponse.getError().getError(), Toast.LENGTH_LONG).show();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
String target = channel.getAcct();
|
if (statusAction == RetrofitPeertubeAPI.ActionType.MUTE) {
|
||||||
//IF action is unfollow or mute, sends an intent to remove statuses
|
|
||||||
if (statusAction == RetrofitPeertubeAPI.ActionType.UNFOLLOW) {
|
|
||||||
Bundle b = new Bundle();
|
|
||||||
b.putString("receive_action", apiResponse.getTargetedId());
|
|
||||||
Intent intentBC = new Intent(Helper.RECEIVE_ACTION);
|
|
||||||
intentBC.putExtras(b);
|
|
||||||
}
|
|
||||||
if (statusAction == RetrofitPeertubeAPI.ActionType.UNFOLLOW || statusAction == RetrofitPeertubeAPI.ActionType.FOLLOW) {
|
|
||||||
RelationshipVM viewModel = new ViewModelProvider(ShowAccountActivity.this).get(RelationshipVM.class);
|
|
||||||
List<String> uris = new ArrayList<>();
|
|
||||||
uris.add(target);
|
|
||||||
viewModel.get(uris).observe(ShowAccountActivity.this, this::manageVIewRelationship);
|
|
||||||
} else if (statusAction == RetrofitPeertubeAPI.ActionType.MUTE) {
|
|
||||||
Toasty.info(ShowAccountActivity.this, getString(R.string.muted_done), Toast.LENGTH_LONG).show();
|
Toasty.info(ShowAccountActivity.this, getString(R.string.muted_done), Toast.LENGTH_LONG).show();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void manageViewAccounts(APIResponse apiResponse) {
|
public void manageViewAccounts(APIResponse apiResponse) {
|
||||||
if (apiResponse.getChannels() != null && apiResponse.getChannels().size() == 1) {
|
if (apiResponse.getAccounts() != null && apiResponse.getAccounts().size() == 1) {
|
||||||
Channel channel = apiResponse.getChannels().get(0);
|
AccountData.Account account = apiResponse.getAccounts().get(0);
|
||||||
if (this.channel == null) {
|
if (this.account == null) {
|
||||||
this.channel = channel;
|
this.account = account;
|
||||||
manageChannel();
|
manageAccount();
|
||||||
}
|
}
|
||||||
if (channel.getOwnerAccount() != null) {
|
subscriber_count.setText(getString(R.string.followers_count, Helper.withSuffix(account.getFollowersCount())));
|
||||||
this.channel.setOwnerAccount(channel.getOwnerAccount());
|
|
||||||
}
|
|
||||||
subscriber_count.setText(getString(R.string.followers_count, Helper.withSuffix(channel.getFollowersCount())));
|
|
||||||
subscriber_count.setVisibility(View.VISIBLE);
|
subscriber_count.setVisibility(View.VISIBLE);
|
||||||
manageNotes(channel);
|
manageNotes(account);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void manageNotes(Channel channel) {
|
private void manageNotes(AccountData.Account account) {
|
||||||
if (channel.getDescription() != null && channel.getDescription().compareTo("null") != 0 && channel.getDescription().trim().length() > 0) {
|
if (account.getDescription() != null && account.getDescription().compareTo("null") != 0 && account.getDescription().trim().length() > 0) {
|
||||||
SpannableString spannableString;
|
SpannableString spannableString;
|
||||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N)
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N)
|
||||||
spannableString = new SpannableString(Html.fromHtml(channel.getDescription(), FROM_HTML_MODE_LEGACY));
|
spannableString = new SpannableString(Html.fromHtml(account.getDescription(), FROM_HTML_MODE_LEGACY));
|
||||||
else
|
else
|
||||||
spannableString = new SpannableString(Html.fromHtml(channel.getDescription()));
|
spannableString = new SpannableString(Html.fromHtml(account.getDescription()));
|
||||||
|
|
||||||
account_note.setText(spannableString, TextView.BufferType.SPANNABLE);
|
account_note.setText(spannableString, TextView.BufferType.SPANNABLE);
|
||||||
account_note.setMovementMethod(LinkMovementMethod.getInstance());
|
account_note.setMovementMethod(LinkMovementMethod.getInstance());
|
||||||
@ -395,11 +260,6 @@ public class ShowAccountActivity extends AppCompatActivity {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public enum action {
|
|
||||||
FOLLOW,
|
|
||||||
UNFOLLOW,
|
|
||||||
NOTHING
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Pager adapter for the 2 fragments
|
* Pager adapter for the 2 fragments
|
||||||
@ -415,25 +275,24 @@ public class ShowAccountActivity extends AppCompatActivity {
|
|||||||
public Fragment getItem(int position) {
|
public Fragment getItem(int position) {
|
||||||
Bundle bundle = new Bundle();
|
Bundle bundle = new Bundle();
|
||||||
if (position == 0) {
|
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();
|
DisplayVideosFragment displayVideosFragment = new DisplayVideosFragment();
|
||||||
bundle = new Bundle();
|
bundle.putSerializable(Helper.TIMELINE_TYPE, TimelineVM.TimelineType.ACCOUNT_VIDEOS);
|
||||||
bundle.putSerializable("type", TimelineVM.TimelineType.USER_VIDEOS);
|
bundle.putString("channelId", account.getAcct());
|
||||||
bundle.putString("channelId", channel.getAcct());
|
bundle.putString("peertube_instance", account.getHost());
|
||||||
displayVideosFragment.setArguments(bundle);
|
displayVideosFragment.setArguments(bundle);
|
||||||
return displayVideosFragment;
|
return displayVideosFragment;
|
||||||
}
|
}
|
||||||
DisplayAccountsFragment displayAccountsFragment = new DisplayAccountsFragment();
|
|
||||||
bundle.putString("targetedid", channel.getId());
|
|
||||||
bundle.putString("instance", getLiveInstance(ShowAccountActivity.this));
|
|
||||||
bundle.putString("name", channel.getAcct());
|
|
||||||
displayAccountsFragment.setArguments(bundle);
|
|
||||||
return displayAccountsFragment;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int getCount() {
|
public int getCount() {
|
||||||
return 1;
|
return 2;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -70,9 +70,7 @@ import static app.fedilab.fedilabtube.client.RetrofitPeertubeAPI.ActionType.MUTE
|
|||||||
import static app.fedilab.fedilabtube.client.RetrofitPeertubeAPI.ActionType.REPORT_ACCOUNT;
|
import static app.fedilab.fedilabtube.client.RetrofitPeertubeAPI.ActionType.REPORT_ACCOUNT;
|
||||||
import static app.fedilab.fedilabtube.client.RetrofitPeertubeAPI.ActionType.UNFOLLOW;
|
import static app.fedilab.fedilabtube.client.RetrofitPeertubeAPI.ActionType.UNFOLLOW;
|
||||||
import static app.fedilab.fedilabtube.client.RetrofitPeertubeAPI.DataType.CHANNEL;
|
import static app.fedilab.fedilabtube.client.RetrofitPeertubeAPI.DataType.CHANNEL;
|
||||||
import static app.fedilab.fedilabtube.helper.Helper.getLiveInstance;
|
|
||||||
import static app.fedilab.fedilabtube.helper.Helper.isLoggedIn;
|
import static app.fedilab.fedilabtube.helper.Helper.isLoggedIn;
|
||||||
import static app.fedilab.fedilabtube.viewmodel.TimelineVM.TimelineType.SEPIA_SEARCH;
|
|
||||||
|
|
||||||
|
|
||||||
public class ShowChannelActivity extends AppCompatActivity {
|
public class ShowChannelActivity extends AppCompatActivity {
|
||||||
@ -94,7 +92,7 @@ public class ShowChannelActivity extends AppCompatActivity {
|
|||||||
@Override
|
@Override
|
||||||
protected void onCreate(Bundle savedInstanceState) {
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
setContentView(R.layout.activity_show_account);
|
setContentView(R.layout.activity_show_channel);
|
||||||
setTitle("");
|
setTitle("");
|
||||||
Bundle b = getIntent().getExtras();
|
Bundle b = getIntent().getExtras();
|
||||||
account_follow = findViewById(R.id.account_follow);
|
account_follow = findViewById(R.id.account_follow);
|
||||||
@ -324,12 +322,11 @@ public class ShowChannelActivity extends AppCompatActivity {
|
|||||||
account_follow.setBackgroundTintList(ColorStateList.valueOf(ContextCompat.getColor(ShowChannelActivity.this, R.color.red_1)));
|
account_follow.setBackgroundTintList(ColorStateList.valueOf(ContextCompat.getColor(ShowChannelActivity.this, R.color.red_1)));
|
||||||
}
|
}
|
||||||
doAction = action.UNFOLLOW;
|
doAction = action.UNFOLLOW;
|
||||||
account_follow.setVisibility(View.VISIBLE);
|
|
||||||
} else {
|
} else {
|
||||||
account_follow.setText(R.string.action_follow);
|
account_follow.setText(R.string.action_follow);
|
||||||
doAction = action.FOLLOW;
|
doAction = action.FOLLOW;
|
||||||
account_follow.setVisibility(View.VISIBLE);
|
|
||||||
}
|
}
|
||||||
|
account_follow.setVisibility(View.VISIBLE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -420,7 +417,7 @@ public class ShowChannelActivity extends AppCompatActivity {
|
|||||||
public Fragment getItem(int position) {
|
public Fragment getItem(int position) {
|
||||||
DisplayVideosFragment displayVideosFragment = new DisplayVideosFragment();
|
DisplayVideosFragment displayVideosFragment = new DisplayVideosFragment();
|
||||||
Bundle bundle = new Bundle();
|
Bundle bundle = new Bundle();
|
||||||
bundle.putSerializable(Helper.TIMELINE_TYPE, TimelineVM.TimelineType.USER_VIDEOS);
|
bundle.putSerializable(Helper.TIMELINE_TYPE, TimelineVM.TimelineType.CHANNEL_VIDEOS);
|
||||||
bundle.putString("channelId", channel.getAcct());
|
bundle.putString("channelId", channel.getAcct());
|
||||||
bundle.putString("peertube_instance", channel.getHost());
|
bundle.putString("peertube_instance", channel.getHost());
|
||||||
bundle.putBoolean("sepia_search", sepiaSearch);
|
bundle.putBoolean("sepia_search", sepiaSearch);
|
||||||
|
@ -129,11 +129,11 @@ public class WebviewActivity extends AppCompatActivity {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean onOptionsItemSelected(MenuItem item) {
|
public boolean onOptionsItemSelected(MenuItem item) {
|
||||||
switch (item.getItemId()) {
|
int itemId = item.getItemId();
|
||||||
case android.R.id.home:
|
if (itemId == android.R.id.home) {
|
||||||
finish();
|
finish();
|
||||||
return true;
|
return true;
|
||||||
case R.id.action_go:
|
} else if (itemId == R.id.action_go) {
|
||||||
Intent browserIntent = new Intent(Intent.ACTION_VIEW, Uri.parse(url));
|
Intent browserIntent = new Intent(Intent.ACTION_VIEW, Uri.parse(url));
|
||||||
try {
|
try {
|
||||||
startActivity(browserIntent);
|
startActivity(browserIntent);
|
||||||
@ -141,9 +141,8 @@ public class WebviewActivity extends AppCompatActivity {
|
|||||||
Toasty.error(WebviewActivity.this, getString(R.string.toast_error), Toast.LENGTH_LONG).show();
|
Toasty.error(WebviewActivity.this, getString(R.string.toast_error), Toast.LENGTH_LONG).show();
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
default:
|
|
||||||
return super.onOptionsItemSelected(item);
|
|
||||||
}
|
}
|
||||||
|
return super.onOptionsItemSelected(item);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setUrl(String newUrl) {
|
public void setUrl(String newUrl) {
|
||||||
|
@ -46,6 +46,7 @@ public class APIResponse {
|
|||||||
private List<CommentData.Comment> comments = null;
|
private List<CommentData.Comment> comments = null;
|
||||||
private List<Block> muted;
|
private List<Block> muted;
|
||||||
private List<VideoPlaylist> videoPlaylist;
|
private List<VideoPlaylist> videoPlaylist;
|
||||||
|
private CommentData.CommentThreadData commentThreadData;
|
||||||
private List<NotificationData.Notification> peertubeNotifications = null;
|
private List<NotificationData.Notification> peertubeNotifications = null;
|
||||||
private List<PlaylistData.Playlist> playlists = null;
|
private List<PlaylistData.Playlist> playlists = null;
|
||||||
private List<String> domains = null;
|
private List<String> domains = null;
|
||||||
@ -247,4 +248,12 @@ public class APIResponse {
|
|||||||
public void setVideoExistPlaylist(Map<String, List<PlaylistExist>> videoExistPlaylist) {
|
public void setVideoExistPlaylist(Map<String, List<PlaylistExist>> videoExistPlaylist) {
|
||||||
this.videoExistPlaylist = videoExistPlaylist;
|
this.videoExistPlaylist = videoExistPlaylist;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public CommentData.CommentThreadData getCommentThreadData() {
|
||||||
|
return commentThreadData;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCommentThreadData(CommentData.CommentThreadData commentThreadData) {
|
||||||
|
this.commentThreadData = commentThreadData;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -17,6 +17,7 @@ package app.fedilab.fedilabtube.client;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
|
|
||||||
import app.fedilab.fedilabtube.client.data.AccountData;
|
import app.fedilab.fedilabtube.client.data.AccountData;
|
||||||
import app.fedilab.fedilabtube.client.data.BlockData;
|
import app.fedilab.fedilabtube.client.data.BlockData;
|
||||||
import app.fedilab.fedilabtube.client.data.CaptionData;
|
import app.fedilab.fedilabtube.client.data.CaptionData;
|
||||||
@ -165,7 +166,7 @@ public interface PeertubeService {
|
|||||||
|
|
||||||
//Get my video
|
//Get my video
|
||||||
@GET("accounts/{name}/videos?sort=-publishedAt")
|
@GET("accounts/{name}/videos?sort=-publishedAt")
|
||||||
Call<VideoData.Video> getVideosForAccount(@Query("start") String maxId, @Query("count") String count);
|
Call<VideoData> getVideosForAccount(@Path("name") String name, @Query("start") String maxId, @Query("count") String count);
|
||||||
|
|
||||||
@Multipart
|
@Multipart
|
||||||
@PUT("videos/{id}")
|
@PUT("videos/{id}")
|
||||||
@ -228,6 +229,11 @@ public interface PeertubeService {
|
|||||||
@GET("video-playlists")
|
@GET("video-playlists")
|
||||||
Call<PlaylistData> getPlaylists();
|
Call<PlaylistData> getPlaylists();
|
||||||
|
|
||||||
|
|
||||||
|
//Get a single account
|
||||||
|
@GET("accounts/{accountHandle}")
|
||||||
|
Call<AccountData.Account> getAccount(@Path("accountHandle") String accountHandle);
|
||||||
|
|
||||||
//Get/Post/Update/Delete playlist
|
//Get/Post/Update/Delete playlist
|
||||||
@GET("accounts/{accountHandle}/video-playlists")
|
@GET("accounts/{accountHandle}/video-playlists")
|
||||||
Call<PlaylistData> getPlaylistsForAccount(@Header("Authorization") String credentials, @Path("accountHandle") String accountHandle);
|
Call<PlaylistData> getPlaylistsForAccount(@Header("Authorization") String credentials, @Path("accountHandle") String accountHandle);
|
||||||
@ -328,15 +334,15 @@ public interface PeertubeService {
|
|||||||
Call<CommentData> getComments(@Path("id") String id, @Query("start") String maxId, @Query("count") String count);
|
Call<CommentData> getComments(@Path("id") String id, @Query("start") String maxId, @Query("count") String count);
|
||||||
|
|
||||||
@GET("videos/{id}/comment-threads/{threadId}")
|
@GET("videos/{id}/comment-threads/{threadId}")
|
||||||
Call<CommentData> getReplies(@Path("id") String id, @Path("threadId") String threadId);
|
Call<CommentData.CommentThreadData> getReplies(@Path("id") String id, @Path("threadId") String threadId);
|
||||||
|
|
||||||
@FormUrlEncoded
|
@FormUrlEncoded
|
||||||
@POST("videos/{id}/comment-threads")
|
@POST("videos/{id}/comment-threads")
|
||||||
Call<String> postComment(@Header("Authorization") String credentials, @Path("id") String id, @Field("text") String text);
|
Call<CommentData.CommentPosted> postComment(@Header("Authorization") String credentials, @Path("id") String id, @Field("text") String text);
|
||||||
|
|
||||||
@FormUrlEncoded
|
@FormUrlEncoded
|
||||||
@POST("videos/{id}/comments/{commentId}")
|
@POST("videos/{id}/comments/{commentId}")
|
||||||
Call<String> postReply(@Header("Authorization") String credentials, @Path("id") String id, @Path("commentId") String commentId, @Field("text") String text);
|
Call<CommentData.CommentPosted> postReply(@Header("Authorization") String credentials, @Path("id") String id, @Path("commentId") String commentId, @Field("text") String text);
|
||||||
|
|
||||||
@DELETE("videos/{id}/comments/{commentId}")
|
@DELETE("videos/{id}/comments/{commentId}")
|
||||||
Call<String> deleteComment(@Header("Authorization") String credentials, @Path("id") String id, @Path("commentId") String commentId);
|
Call<String> deleteComment(@Header("Authorization") String credentials, @Path("id") String id, @Path("commentId") String commentId);
|
||||||
|
@ -82,12 +82,12 @@ import retrofit2.converter.gson.GsonConverterFactory;
|
|||||||
@SuppressWarnings({"unused", "RedundantSuppression"})
|
@SuppressWarnings({"unused", "RedundantSuppression"})
|
||||||
public class RetrofitPeertubeAPI {
|
public class RetrofitPeertubeAPI {
|
||||||
|
|
||||||
private String finalUrl;
|
private final String finalUrl;
|
||||||
private Context _context;
|
private final Context _context;
|
||||||
private String instance;
|
private final String instance;
|
||||||
private String token;
|
private String token;
|
||||||
private Set<String> selection;
|
private Set<String> selection;
|
||||||
private String count;
|
private final String count;
|
||||||
|
|
||||||
public RetrofitPeertubeAPI(Context context) {
|
public RetrofitPeertubeAPI(Context context) {
|
||||||
_context = context;
|
_context = context;
|
||||||
@ -320,6 +320,9 @@ public class RetrofitPeertubeAPI {
|
|||||||
case MY_VIDEOS:
|
case MY_VIDEOS:
|
||||||
videoCall = peertubeService.getMyVideos(getToken(), max_id, count);
|
videoCall = peertubeService.getMyVideos(getToken(), max_id, count);
|
||||||
break;
|
break;
|
||||||
|
case ACCOUNT_VIDEOS:
|
||||||
|
videoCall = peertubeService.getVideosForAccount(forAccount, max_id, count);
|
||||||
|
break;
|
||||||
case SUBSCRIBTIONS:
|
case SUBSCRIBTIONS:
|
||||||
if (forAccount == null) {
|
if (forAccount == null) {
|
||||||
videoCall = peertubeService.getSubscriptionVideos(getToken(), max_id, count, filter);
|
videoCall = peertubeService.getSubscriptionVideos(getToken(), max_id, count, filter);
|
||||||
@ -562,6 +565,9 @@ public class RetrofitPeertubeAPI {
|
|||||||
lang = lang.split("-")[0] + "-" + lang.split("-")[1].toUpperCase();
|
lang = lang.split("-")[0] + "-" + lang.split("-")[1].toUpperCase();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if( lang == null || lang.trim().length() == 0) {
|
||||||
|
lang = "en";
|
||||||
|
}
|
||||||
Call<Map<String, String>> translations = initTranslation().getTranslations(lang);
|
Call<Map<String, String>> translations = initTranslation().getTranslations(lang);
|
||||||
try {
|
try {
|
||||||
Response<Map<String, String>> response = translations.execute();
|
Response<Map<String, String>> response = translations.execute();
|
||||||
@ -841,6 +847,38 @@ public class RetrofitPeertubeAPI {
|
|||||||
return apiResponse;
|
return apiResponse;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get single account by its handle
|
||||||
|
*
|
||||||
|
* @param accountHandle String
|
||||||
|
* @return APIResponse
|
||||||
|
*/
|
||||||
|
public APIResponse getAccount(String accountHandle) {
|
||||||
|
PeertubeService peertubeService = init();
|
||||||
|
Call<AccountData.Account> accountDataCall = peertubeService.getAccount(accountHandle);
|
||||||
|
APIResponse apiResponse = new APIResponse();
|
||||||
|
if (accountDataCall != null) {
|
||||||
|
try {
|
||||||
|
Response<AccountData.Account> response = accountDataCall.execute();
|
||||||
|
if (response.isSuccessful() && response.body() != null) {
|
||||||
|
List<AccountData.Account> accountList = new ArrayList<>();
|
||||||
|
accountList.add(response.body());
|
||||||
|
apiResponse.setAccounts(accountList);
|
||||||
|
} 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;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get muted accounts
|
* Get muted accounts
|
||||||
*
|
*
|
||||||
@ -1200,10 +1238,10 @@ public class RetrofitPeertubeAPI {
|
|||||||
setError(apiResponse, response.code(), response.errorBody());
|
setError(apiResponse, response.code(), response.errorBody());
|
||||||
}
|
}
|
||||||
} else if (type == CommentVM.action.GET_REPLIES) {
|
} else if (type == CommentVM.action.GET_REPLIES) {
|
||||||
Call<CommentData> commentsCall = peertubeService.getReplies(videoId, forCommentId);
|
Call<CommentData.CommentThreadData> commentsCall = peertubeService.getReplies(videoId, forCommentId);
|
||||||
Response<CommentData> response = commentsCall.execute();
|
Response<CommentData.CommentThreadData> response = commentsCall.execute();
|
||||||
if (response.isSuccessful() && response.body() != null) {
|
if (response.isSuccessful() && response.body() != null) {
|
||||||
apiResponse.setComments(response.body().data);
|
apiResponse.setCommentThreadData(response.body());
|
||||||
} else {
|
} else {
|
||||||
setError(apiResponse, response.code(), response.errorBody());
|
setError(apiResponse, response.code(), response.errorBody());
|
||||||
}
|
}
|
||||||
@ -1232,18 +1270,22 @@ public class RetrofitPeertubeAPI {
|
|||||||
APIResponse apiResponse = new APIResponse();
|
APIResponse apiResponse = new APIResponse();
|
||||||
try {
|
try {
|
||||||
if (type == ActionType.ADD_COMMENT) {
|
if (type == ActionType.ADD_COMMENT) {
|
||||||
Call<String> stringCall = peertubeService.postComment(getToken(), videoId, text);
|
Call<CommentData.CommentPosted> commentPostedCall = peertubeService.postComment(getToken(), videoId, text);
|
||||||
Response<String> response = stringCall.execute();
|
Response<CommentData.CommentPosted> response = commentPostedCall.execute();
|
||||||
if (response.isSuccessful()) {
|
if (response.isSuccessful() && response.body() != null) {
|
||||||
apiResponse.setActionReturn(response.body());
|
List<CommentData.Comment> comments = new ArrayList<>();
|
||||||
|
comments.add(response.body().getComment());
|
||||||
|
apiResponse.setComments(comments);
|
||||||
} else {
|
} else {
|
||||||
setError(apiResponse, response.code(), response.errorBody());
|
setError(apiResponse, response.code(), response.errorBody());
|
||||||
}
|
}
|
||||||
} else if (type == ActionType.REPLY) {
|
} else if (type == ActionType.REPLY) {
|
||||||
Call<String> stringCall = peertubeService.postReply(getToken(), videoId, toCommentId, text);
|
Call<CommentData.CommentPosted> commentPostedCall = peertubeService.postReply(getToken(), videoId, toCommentId, text);
|
||||||
Response<String> response = stringCall.execute();
|
Response<CommentData.CommentPosted> response = commentPostedCall.execute();
|
||||||
if (response.isSuccessful()) {
|
if (response.isSuccessful() && response.body() != null) {
|
||||||
apiResponse.setActionReturn(response.body());
|
List<CommentData.Comment> comments = new ArrayList<>();
|
||||||
|
comments.add(response.body().getComment());
|
||||||
|
apiResponse.setComments(comments);
|
||||||
} else {
|
} else {
|
||||||
setError(apiResponse, response.code(), response.errorBody());
|
setError(apiResponse, response.code(), response.errorBody());
|
||||||
}
|
}
|
||||||
|
@ -56,6 +56,8 @@ public class CommentData {
|
|||||||
private String url;
|
private String url;
|
||||||
@SerializedName("videoId")
|
@SerializedName("videoId")
|
||||||
private String videoId;
|
private String videoId;
|
||||||
|
private boolean isReply = false;
|
||||||
|
private boolean isReplyViewOpen = false;
|
||||||
|
|
||||||
|
|
||||||
public AccountData.Account getAccount() {
|
public AccountData.Account getAccount() {
|
||||||
@ -161,8 +163,63 @@ public class CommentData {
|
|||||||
public void setVideoId(String videoId) {
|
public void setVideoId(String videoId) {
|
||||||
this.videoId = videoId;
|
this.videoId = videoId;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean isReply() {
|
||||||
|
return isReply;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void setReply(boolean reply) {
|
||||||
|
isReply = reply;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isReplyViewOpen() {
|
||||||
|
return isReplyViewOpen;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setReplyViewOpen(boolean replyViewOpen) {
|
||||||
|
isReplyViewOpen = replyViewOpen;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public static class CommentThreadData {
|
||||||
|
|
||||||
|
@SerializedName("comment")
|
||||||
|
public Comment comment;
|
||||||
|
@SerializedName("children")
|
||||||
|
public List<CommentThreadData> children;
|
||||||
|
|
||||||
|
public Comment getComment() {
|
||||||
|
return comment;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setComment(Comment comment) {
|
||||||
|
this.comment = comment;
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<CommentThreadData> getChildren() {
|
||||||
|
return children;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setChildren(List<CommentThreadData> children) {
|
||||||
|
this.children = children;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static class CommentPosted{
|
||||||
|
@SerializedName("comment")
|
||||||
|
private Comment comment;
|
||||||
|
|
||||||
|
public Comment getComment() {
|
||||||
|
return comment;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setComment(Comment comment) {
|
||||||
|
this.comment = comment;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
public static class NotificationComment {
|
public static class NotificationComment {
|
||||||
@SerializedName("id")
|
@SerializedName("id")
|
||||||
private String id;
|
private String id;
|
||||||
|
@ -46,6 +46,8 @@ public class NotificationData {
|
|||||||
private CommentData.NotificationComment comment;
|
private CommentData.NotificationComment comment;
|
||||||
@SerializedName("videoAbuse")
|
@SerializedName("videoAbuse")
|
||||||
private VideoAbuse videoAbuse;
|
private VideoAbuse videoAbuse;
|
||||||
|
@SerializedName("abuse")
|
||||||
|
private VideoAbuse.Abuse abuse;
|
||||||
@SerializedName("videoBlacklist")
|
@SerializedName("videoBlacklist")
|
||||||
private VideoBlacklist videoBlacklist;
|
private VideoBlacklist videoBlacklist;
|
||||||
@SerializedName("account")
|
@SerializedName("account")
|
||||||
@ -153,5 +155,13 @@ public class NotificationData {
|
|||||||
public void setUpdatedAt(Date updatedAt) {
|
public void setUpdatedAt(Date updatedAt) {
|
||||||
this.updatedAt = updatedAt;
|
this.updatedAt = updatedAt;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public VideoAbuse.Abuse getAbuse() {
|
||||||
|
return abuse;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setAbuse(VideoAbuse.Abuse abuse) {
|
||||||
|
this.abuse = abuse;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -16,6 +16,7 @@ package app.fedilab.fedilabtube.client.entities;
|
|||||||
|
|
||||||
import com.google.gson.annotations.SerializedName;
|
import com.google.gson.annotations.SerializedName;
|
||||||
|
|
||||||
|
import app.fedilab.fedilabtube.client.data.CommentData;
|
||||||
import app.fedilab.fedilabtube.client.data.VideoData;
|
import app.fedilab.fedilabtube.client.data.VideoData;
|
||||||
|
|
||||||
@SuppressWarnings({"unused", "RedundantSuppression"})
|
@SuppressWarnings({"unused", "RedundantSuppression"})
|
||||||
@ -41,4 +42,38 @@ public class VideoAbuse {
|
|||||||
public void setVideo(VideoData.Video video) {
|
public void setVideo(VideoData.Video video) {
|
||||||
this.video = video;
|
this.video = video;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public static class Abuse{
|
||||||
|
@SerializedName("comment")
|
||||||
|
private CommentData.Comment comment;
|
||||||
|
@SerializedName("threadId")
|
||||||
|
private String threadId;
|
||||||
|
@SerializedName("id")
|
||||||
|
private String id;
|
||||||
|
|
||||||
|
public CommentData.Comment getComment() {
|
||||||
|
return comment;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setComment(CommentData.Comment comment) {
|
||||||
|
this.comment = comment;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getThreadId() {
|
||||||
|
return threadId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setThreadId(String threadId) {
|
||||||
|
this.threadId = threadId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getId() {
|
||||||
|
return id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setId(String id) {
|
||||||
|
this.id = id;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -48,10 +48,10 @@ import es.dmoral.toasty.Toasty;
|
|||||||
public class AccountsListAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> {
|
public class AccountsListAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> {
|
||||||
|
|
||||||
public AllAccountsRemoved allAccountsRemoved;
|
public AllAccountsRemoved allAccountsRemoved;
|
||||||
private List<Account> accounts;
|
private final List<Account> accounts;
|
||||||
private Context context;
|
private Context context;
|
||||||
private AccountsListAdapter accountsListAdapter;
|
private final AccountsListAdapter accountsListAdapter;
|
||||||
private RetrofitPeertubeAPI.DataType type;
|
private final RetrofitPeertubeAPI.DataType type;
|
||||||
|
|
||||||
public AccountsListAdapter(RetrofitPeertubeAPI.DataType type, List<Account> accounts) {
|
public AccountsListAdapter(RetrofitPeertubeAPI.DataType type, List<Account> accounts) {
|
||||||
this.accounts = accounts;
|
this.accounts = accounts;
|
||||||
@ -96,7 +96,8 @@ public class AccountsListAdapter extends RecyclerView.Adapter<RecyclerView.ViewH
|
|||||||
holder.account_pp.setOnClickListener(v -> {
|
holder.account_pp.setOnClickListener(v -> {
|
||||||
Intent intent = new Intent(context, ShowAccountActivity.class);
|
Intent intent = new Intent(context, ShowAccountActivity.class);
|
||||||
Bundle b = new Bundle();
|
Bundle b = new Bundle();
|
||||||
b.putParcelable("channel", account);
|
b.putParcelable("account", account);
|
||||||
|
b.putString("accountAcct", account.getAcct());
|
||||||
intent.putExtras(b);
|
intent.putExtras(b);
|
||||||
context.startActivity(intent);
|
context.startActivity(intent);
|
||||||
});
|
});
|
||||||
|
@ -46,12 +46,14 @@ public class ChannelListAdapter extends RecyclerView.Adapter<RecyclerView.ViewHo
|
|||||||
|
|
||||||
public AllChannelRemoved allChannelRemoved;
|
public AllChannelRemoved allChannelRemoved;
|
||||||
public EditAlertDialog editAlertDialog;
|
public EditAlertDialog editAlertDialog;
|
||||||
private List<Channel> channels;
|
private final List<Channel> channels;
|
||||||
private Context context;
|
private Context context;
|
||||||
|
private final boolean myChannel;
|
||||||
|
|
||||||
|
|
||||||
public ChannelListAdapter(List<Channel> channels) {
|
public ChannelListAdapter(List<Channel> channels, boolean myChannel) {
|
||||||
this.channels = channels;
|
this.channels = channels;
|
||||||
|
this.myChannel = myChannel;
|
||||||
}
|
}
|
||||||
|
|
||||||
@NonNull
|
@NonNull
|
||||||
@ -75,7 +77,9 @@ public class ChannelListAdapter extends RecyclerView.Adapter<RecyclerView.ViewHo
|
|||||||
//Profile picture
|
//Profile picture
|
||||||
Helper.loadGiF(context, channel.getAvatar() != null ? channel.getAvatar().getPath() : null, holder.account_pp);
|
Helper.loadGiF(context, channel.getAvatar() != null ? channel.getAvatar().getPath() : null, holder.account_pp);
|
||||||
|
|
||||||
|
if( !this.myChannel) {
|
||||||
|
holder.more_actions.setVisibility(View.GONE);
|
||||||
|
}
|
||||||
holder.more_actions.setOnClickListener(view -> {
|
holder.more_actions.setOnClickListener(view -> {
|
||||||
PopupMenu popup = new PopupMenu(context, holder.more_actions);
|
PopupMenu popup = new PopupMenu(context, holder.more_actions);
|
||||||
popup.getMenuInflater()
|
popup.getMenuInflater()
|
||||||
@ -84,8 +88,8 @@ public class ChannelListAdapter extends RecyclerView.Adapter<RecyclerView.ViewHo
|
|||||||
popup.getMenu().findItem(R.id.action_delete).setEnabled(false);
|
popup.getMenu().findItem(R.id.action_delete).setEnabled(false);
|
||||||
}
|
}
|
||||||
popup.setOnMenuItemClickListener(item -> {
|
popup.setOnMenuItemClickListener(item -> {
|
||||||
switch (item.getItemId()) {
|
int itemId = item.getItemId();
|
||||||
case R.id.action_delete:
|
if (itemId == R.id.action_delete) {
|
||||||
AlertDialog.Builder builder = new AlertDialog.Builder(context);
|
AlertDialog.Builder builder = new AlertDialog.Builder(context);
|
||||||
builder.setTitle(context.getString(R.string.delete_channel) + ": " + channel.getName());
|
builder.setTitle(context.getString(R.string.delete_channel) + ": " + channel.getName());
|
||||||
builder.setMessage(context.getString(R.string.action_channel_confirm_delete));
|
builder.setMessage(context.getString(R.string.action_channel_confirm_delete));
|
||||||
@ -107,12 +111,10 @@ public class ChannelListAdapter extends RecyclerView.Adapter<RecyclerView.ViewHo
|
|||||||
})
|
})
|
||||||
.setNegativeButton(R.string.no, (dialog, which) -> dialog.dismiss())
|
.setNegativeButton(R.string.no, (dialog, which) -> dialog.dismiss())
|
||||||
.show();
|
.show();
|
||||||
break;
|
} else if (itemId == R.id.action_edit) {
|
||||||
case R.id.action_edit:
|
|
||||||
if (context instanceof AccountActivity) {
|
if (context instanceof AccountActivity) {
|
||||||
editAlertDialog.show(channel);
|
editAlertDialog.show(channel);
|
||||||
}
|
}
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
});
|
});
|
||||||
|
@ -16,8 +16,11 @@ package app.fedilab.fedilabtube.drawer;
|
|||||||
|
|
||||||
import android.annotation.SuppressLint;
|
import android.annotation.SuppressLint;
|
||||||
import android.app.Activity;
|
import android.app.Activity;
|
||||||
|
import android.app.AlertDialog;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
|
import android.content.Intent;
|
||||||
import android.os.Build;
|
import android.os.Build;
|
||||||
|
import android.os.Bundle;
|
||||||
import android.os.Handler;
|
import android.os.Handler;
|
||||||
import android.os.Looper;
|
import android.os.Looper;
|
||||||
import android.text.Html;
|
import android.text.Html;
|
||||||
@ -38,6 +41,7 @@ import android.widget.Toast;
|
|||||||
|
|
||||||
import androidx.annotation.NonNull;
|
import androidx.annotation.NonNull;
|
||||||
import androidx.appcompat.widget.PopupMenu;
|
import androidx.appcompat.widget.PopupMenu;
|
||||||
|
import androidx.constraintlayout.widget.ConstraintLayout;
|
||||||
import androidx.core.content.ContextCompat;
|
import androidx.core.content.ContextCompat;
|
||||||
import androidx.lifecycle.LifecycleOwner;
|
import androidx.lifecycle.LifecycleOwner;
|
||||||
import androidx.lifecycle.ViewModelProvider;
|
import androidx.lifecycle.ViewModelProvider;
|
||||||
@ -48,17 +52,23 @@ import java.util.List;
|
|||||||
import java.util.regex.Matcher;
|
import java.util.regex.Matcher;
|
||||||
import java.util.regex.Pattern;
|
import java.util.regex.Pattern;
|
||||||
|
|
||||||
|
import app.fedilab.fedilabtube.PeertubeActivity;
|
||||||
import app.fedilab.fedilabtube.R;
|
import app.fedilab.fedilabtube.R;
|
||||||
import app.fedilab.fedilabtube.ShowAccountActivity;
|
import app.fedilab.fedilabtube.ShowAccountActivity;
|
||||||
|
import app.fedilab.fedilabtube.ShowChannelActivity;
|
||||||
import app.fedilab.fedilabtube.client.APIResponse;
|
import app.fedilab.fedilabtube.client.APIResponse;
|
||||||
import app.fedilab.fedilabtube.client.RetrofitPeertubeAPI;
|
import app.fedilab.fedilabtube.client.RetrofitPeertubeAPI;
|
||||||
import app.fedilab.fedilabtube.client.data.CommentData.Comment;
|
import app.fedilab.fedilabtube.client.data.CommentData.Comment;
|
||||||
import app.fedilab.fedilabtube.client.entities.Report;
|
import app.fedilab.fedilabtube.client.entities.Report;
|
||||||
|
import app.fedilab.fedilabtube.helper.EmojiHelper;
|
||||||
import app.fedilab.fedilabtube.helper.Helper;
|
import app.fedilab.fedilabtube.helper.Helper;
|
||||||
import app.fedilab.fedilabtube.viewmodel.PostActionsVM;
|
import app.fedilab.fedilabtube.viewmodel.PostActionsVM;
|
||||||
import es.dmoral.toasty.Toasty;
|
import es.dmoral.toasty.Toasty;
|
||||||
|
import studio.carbonylgroup.textfieldboxes.ExtendedEditText;
|
||||||
|
|
||||||
import static app.fedilab.fedilabtube.client.RetrofitPeertubeAPI.ActionType.MUTE;
|
import static app.fedilab.fedilabtube.client.RetrofitPeertubeAPI.ActionType.MUTE;
|
||||||
|
import static app.fedilab.fedilabtube.client.RetrofitPeertubeAPI.ActionType.REPLY;
|
||||||
|
import static app.fedilab.fedilabtube.helper.Helper.isLoggedIn;
|
||||||
|
|
||||||
|
|
||||||
public class CommentListAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> {
|
public class CommentListAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> {
|
||||||
@ -66,8 +76,8 @@ public class CommentListAdapter extends RecyclerView.Adapter<RecyclerView.ViewHo
|
|||||||
|
|
||||||
public AllCommentRemoved allCommentRemoved;
|
public AllCommentRemoved allCommentRemoved;
|
||||||
private Context context;
|
private Context context;
|
||||||
private List<Comment> comments;
|
private final List<Comment> comments;
|
||||||
private CommentListAdapter commentListAdapter;
|
private final CommentListAdapter commentListAdapter;
|
||||||
boolean isVideoOwner;
|
boolean isVideoOwner;
|
||||||
|
|
||||||
public CommentListAdapter(List<Comment> comments, boolean isVideoOwner) {
|
public CommentListAdapter(List<Comment> comments, boolean isVideoOwner) {
|
||||||
@ -109,7 +119,7 @@ public class CommentListAdapter extends RecyclerView.Adapter<RecyclerView.ViewHo
|
|||||||
|
|
||||||
if (comment == null)
|
if (comment == null)
|
||||||
return;
|
return;
|
||||||
|
holder.main_container.setTag(i);
|
||||||
|
|
||||||
holder.more_actions.setOnClickListener(view -> {
|
holder.more_actions.setOnClickListener(view -> {
|
||||||
PopupMenu popup = new PopupMenu(context, holder.more_actions);
|
PopupMenu popup = new PopupMenu(context, holder.more_actions);
|
||||||
@ -131,9 +141,9 @@ public class CommentListAdapter extends RecyclerView.Adapter<RecyclerView.ViewHo
|
|||||||
popup.getMenu().findItem(R.id.action_delete).setVisible(false);
|
popup.getMenu().findItem(R.id.action_delete).setVisible(false);
|
||||||
}
|
}
|
||||||
popup.setOnMenuItemClickListener(item -> {
|
popup.setOnMenuItemClickListener(item -> {
|
||||||
switch (item.getItemId()) {
|
int itemId = item.getItemId();
|
||||||
case R.id.action_delete:
|
if (itemId == R.id.action_delete) {
|
||||||
android.app.AlertDialog.Builder builder = new android.app.AlertDialog.Builder(context);
|
AlertDialog.Builder builder = new AlertDialog.Builder(context);
|
||||||
builder.setTitle(R.string.delete_comment);
|
builder.setTitle(R.string.delete_comment);
|
||||||
builder.setMessage(R.string.delete_comment_confirm);
|
builder.setMessage(R.string.delete_comment_confirm);
|
||||||
builder.setIcon(android.R.drawable.ic_dialog_alert)
|
builder.setIcon(android.R.drawable.ic_dialog_alert)
|
||||||
@ -155,21 +165,19 @@ public class CommentListAdapter extends RecyclerView.Adapter<RecyclerView.ViewHo
|
|||||||
})
|
})
|
||||||
.setNegativeButton(R.string.no, (dialog, which) -> dialog.dismiss())
|
.setNegativeButton(R.string.no, (dialog, which) -> dialog.dismiss())
|
||||||
.show();
|
.show();
|
||||||
break;
|
} else if (itemId == R.id.action_report) {
|
||||||
case R.id.action_report:
|
|
||||||
reportComment(comment);
|
reportComment(comment);
|
||||||
break;
|
} else if (itemId == R.id.action_mute) {
|
||||||
case R.id.action_mute:
|
|
||||||
PostActionsVM viewModel = new ViewModelProvider((ViewModelStoreOwner) context).get(PostActionsVM.class);
|
PostActionsVM viewModel = new ViewModelProvider((ViewModelStoreOwner) context).get(PostActionsVM.class);
|
||||||
viewModel.post(MUTE, comment.getAccount().getAcct(), null).observe((LifecycleOwner) context, apiResponse -> manageVIewPostActions(MUTE, apiResponse));
|
viewModel.post(MUTE, comment.getAccount().getAcct(), null).observe((LifecycleOwner) context, apiResponse -> manageVIewPostActions(MUTE, 0, apiResponse));
|
||||||
comments.remove(comment);
|
comments.remove(comment);
|
||||||
notifyDataSetChanged();
|
notifyDataSetChanged();
|
||||||
if (comments.size() == 0) {
|
if (comments.size() == 0) {
|
||||||
allCommentRemoved.onAllCommentRemoved();
|
allCommentRemoved.onAllCommentRemoved();
|
||||||
}
|
}
|
||||||
break;
|
} else if (itemId == R.id.action_remove_comments) {
|
||||||
case R.id.action_remove_comments:
|
AlertDialog.Builder builder;
|
||||||
builder = new android.app.AlertDialog.Builder(context);
|
builder = new AlertDialog.Builder(context);
|
||||||
builder.setTitle(R.string.delete_account_comment);
|
builder.setTitle(R.string.delete_account_comment);
|
||||||
builder.setMessage(R.string.delete_account_comment_confirm);
|
builder.setMessage(R.string.delete_account_comment_confirm);
|
||||||
builder.setIcon(android.R.drawable.ic_dialog_alert)
|
builder.setIcon(android.R.drawable.ic_dialog_alert)
|
||||||
@ -191,7 +199,6 @@ public class CommentListAdapter extends RecyclerView.Adapter<RecyclerView.ViewHo
|
|||||||
})
|
})
|
||||||
.setNegativeButton(R.string.no, (dialog, which) -> dialog.dismiss())
|
.setNegativeButton(R.string.no, (dialog, which) -> dialog.dismiss())
|
||||||
.show();
|
.show();
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
});
|
});
|
||||||
@ -209,15 +216,26 @@ public class CommentListAdapter extends RecyclerView.Adapter<RecyclerView.ViewHo
|
|||||||
|
|
||||||
Spanned commentSpan;
|
Spanned commentSpan;
|
||||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N)
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N)
|
||||||
commentSpan = Html.fromHtml(comment.getText(), Html.FROM_HTML_MODE_LEGACY);
|
commentSpan = Html.fromHtml(EmojiHelper.shortnameToUnicode(comment.getText()), Html.FROM_HTML_MODE_COMPACT);
|
||||||
else
|
else
|
||||||
commentSpan = Html.fromHtml(comment.getText());
|
commentSpan = Html.fromHtml(EmojiHelper.shortnameToUnicode(comment.getText()));
|
||||||
holder.comment_content.setText(commentSpan, TextView.BufferType.SPANNABLE);
|
holder.comment_content.setText(commentSpan, TextView.BufferType.SPANNABLE);
|
||||||
|
|
||||||
holder.comment_content.setMovementMethod(LinkMovementMethod.getInstance());
|
holder.comment_content.setMovementMethod(LinkMovementMethod.getInstance());
|
||||||
|
|
||||||
holder.comment_account_displayname.setText(comment.getAccount().getDisplayName());
|
holder.comment_account_displayname.setText(comment.getAccount().getDisplayName());
|
||||||
|
|
||||||
|
if( context instanceof PeertubeActivity && !comment.isReply()) {
|
||||||
|
holder.main_container.setOnClickListener(v -> ((PeertubeActivity) context).openCommentThread(comment, i));
|
||||||
|
holder.comment_content.setOnClickListener(v -> ((PeertubeActivity) context).openCommentThread(comment, i));
|
||||||
|
}
|
||||||
|
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()));
|
||||||
|
} else {
|
||||||
|
holder.number_of_replies.setVisibility(View.GONE);
|
||||||
|
}
|
||||||
|
|
||||||
if (comment.getAccount() != null) {
|
if (comment.getAccount() != null) {
|
||||||
Spannable wordtoSpan;
|
Spannable wordtoSpan;
|
||||||
Pattern hashAcct;
|
Pattern hashAcct;
|
||||||
@ -238,9 +256,50 @@ public class CommentListAdapter extends RecyclerView.Adapter<RecyclerView.ViewHo
|
|||||||
|
|
||||||
|
|
||||||
Helper.loadGiF(context, comment.getAccount().getAvatar() != null ? comment.getAccount().getAvatar().getPath() : null, holder.comment_account_profile);
|
Helper.loadGiF(context, comment.getAccount().getAvatar() != null ? comment.getAccount().getAvatar().getPath() : null, holder.comment_account_profile);
|
||||||
|
|
||||||
|
holder.comment_account_profile.setOnClickListener(v->{
|
||||||
|
Bundle b = new Bundle();
|
||||||
|
Intent intent = new Intent(context, ShowAccountActivity.class);
|
||||||
|
b.putParcelable("account", comment.getAccount());
|
||||||
|
b.putString("accountAcct", comment.getAccount().getAcct());
|
||||||
|
intent.putExtras(b);
|
||||||
|
context.startActivity(intent);
|
||||||
|
});
|
||||||
|
if(comment.isReply()) {
|
||||||
|
holder.replyButton.setVisibility(View.VISIBLE);
|
||||||
|
}else{
|
||||||
|
holder.replyButton.setVisibility(View.GONE);
|
||||||
|
}
|
||||||
|
if( comment.isReply() && comment.isReplyViewOpen()) {
|
||||||
|
holder.write_comment_container_reply.setVisibility(View.VISIBLE);
|
||||||
|
}else{
|
||||||
|
holder.write_comment_container_reply.setVisibility(View.GONE);
|
||||||
|
}
|
||||||
|
if( holder.add_comment_write_reply.getText() == null || holder.add_comment_write_reply.getText().toString().trim().length() == 0) {
|
||||||
|
holder.add_comment_write_reply.setText(String.format("@%s ", comment.getAccount().getAcct()));
|
||||||
|
holder.add_comment_write_reply.setSelection(holder.add_comment_write_reply.getText().length());
|
||||||
|
}
|
||||||
|
holder.replyButton.setOnClickListener(v->{
|
||||||
|
comment.setReplyViewOpen(!comment.isReplyViewOpen());
|
||||||
|
notifyItemChanged(i);
|
||||||
|
});
|
||||||
|
|
||||||
|
holder.send_reply.setOnClickListener(null);
|
||||||
|
holder.send_reply.setOnClickListener(v -> {
|
||||||
|
if (isLoggedIn(context)) {
|
||||||
|
String commentView = holder.add_comment_write_reply.getText().toString();
|
||||||
|
if (commentView.trim().length() > 0) {
|
||||||
|
PostActionsVM viewModelComment = new ViewModelProvider((ViewModelStoreOwner) context).get(PostActionsVM.class);
|
||||||
|
viewModelComment.comment(REPLY, comment.getVideoId(), comment.getId(), commentView).observe((LifecycleOwner) context, apiResponse1 -> manageVIewPostActions(REPLY, (int)holder.main_container.getTag(), apiResponse1));
|
||||||
|
holder.add_comment_write_reply.setText("");
|
||||||
|
comment.setReplyViewOpen(false);
|
||||||
|
notifyItemChanged(i);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
public void manageVIewPostActions(RetrofitPeertubeAPI.ActionType statusAction, APIResponse apiResponse) {
|
public void manageVIewPostActions(RetrofitPeertubeAPI.ActionType statusAction, int i, APIResponse apiResponse) {
|
||||||
|
|
||||||
if (apiResponse.getError() != null) {
|
if (apiResponse.getError() != null) {
|
||||||
Toasty.error(context, apiResponse.getError().getError(), Toast.LENGTH_LONG).show();
|
Toasty.error(context, apiResponse.getError().getError(), Toast.LENGTH_LONG).show();
|
||||||
@ -256,6 +315,11 @@ public class CommentListAdapter extends RecyclerView.Adapter<RecyclerView.ViewHo
|
|||||||
}
|
}
|
||||||
position++;
|
position++;
|
||||||
}
|
}
|
||||||
|
} else if (statusAction == REPLY) {
|
||||||
|
if( apiResponse.getComments() != null && apiResponse.getComments().size() > 0 ) {
|
||||||
|
comments.add(i+1, apiResponse.getComments().get(0));
|
||||||
|
notifyItemInserted(i+1);
|
||||||
|
}
|
||||||
}else if (statusAction == RetrofitPeertubeAPI.ActionType.REPORT_COMMENT) {
|
}else if (statusAction == RetrofitPeertubeAPI.ActionType.REPORT_COMMENT) {
|
||||||
Toasty.success(context, context.getString(R.string.successful_report_comment), Toasty.LENGTH_LONG).show();
|
Toasty.success(context, context.getString(R.string.successful_report_comment), Toasty.LENGTH_LONG).show();
|
||||||
}else if (statusAction == MUTE) {
|
}else if (statusAction == MUTE) {
|
||||||
@ -281,7 +345,7 @@ public class CommentListAdapter extends RecyclerView.Adapter<RecyclerView.ViewHo
|
|||||||
commentReport.setId(comment.getId());
|
commentReport.setId(comment.getId());
|
||||||
report.setComment(commentReport);
|
report.setComment(commentReport);
|
||||||
report.setReason(report_content.getText().toString());
|
report.setReason(report_content.getText().toString());
|
||||||
viewModel.report(report).observe((LifecycleOwner) context, apiResponse -> manageVIewPostActions(RetrofitPeertubeAPI.ActionType.REPORT_COMMENT, apiResponse));
|
viewModel.report(report).observe((LifecycleOwner) context, apiResponse -> manageVIewPostActions(RetrofitPeertubeAPI.ActionType.REPORT_COMMENT, 0, apiResponse));
|
||||||
dialog.dismiss();
|
dialog.dismiss();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@ -298,10 +362,13 @@ public class CommentListAdapter extends RecyclerView.Adapter<RecyclerView.ViewHo
|
|||||||
TextView comment_content;
|
TextView comment_content;
|
||||||
TextView comment_account_username;
|
TextView comment_account_username;
|
||||||
TextView comment_account_displayname;
|
TextView comment_account_displayname;
|
||||||
ImageView comment_account_profile;
|
ImageView comment_account_profile, send_reply;
|
||||||
TextView comment_date;
|
TextView comment_date, replyButton;
|
||||||
LinearLayout main_container;
|
LinearLayout main_container;
|
||||||
TextView more_actions;
|
TextView more_actions, number_of_replies;
|
||||||
|
ExtendedEditText add_comment_write_reply;
|
||||||
|
ConstraintLayout write_comment_container_reply;
|
||||||
|
|
||||||
|
|
||||||
@SuppressLint("SetJavaScriptEnabled")
|
@SuppressLint("SetJavaScriptEnabled")
|
||||||
ViewHolder(View itemView) {
|
ViewHolder(View itemView) {
|
||||||
@ -313,6 +380,11 @@ public class CommentListAdapter extends RecyclerView.Adapter<RecyclerView.ViewHo
|
|||||||
comment_date = itemView.findViewById(R.id.comment_date);
|
comment_date = itemView.findViewById(R.id.comment_date);
|
||||||
main_container = itemView.findViewById(R.id.main_container);
|
main_container = itemView.findViewById(R.id.main_container);
|
||||||
more_actions = itemView.findViewById(R.id.more_actions);
|
more_actions = itemView.findViewById(R.id.more_actions);
|
||||||
|
number_of_replies = itemView.findViewById(R.id.number_of_replies);
|
||||||
|
add_comment_write_reply = itemView.findViewById(R.id.add_comment_write_reply);
|
||||||
|
send_reply = itemView.findViewById(R.id.send_reply);
|
||||||
|
replyButton = itemView.findViewById(R.id.replyButton);
|
||||||
|
write_comment_container_reply = itemView.findViewById(R.id.write_comment_container_reply);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -46,7 +46,7 @@ import app.fedilab.fedilabtube.helper.Helper;
|
|||||||
public class PeertubeNotificationsListAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> {
|
public class PeertubeNotificationsListAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> {
|
||||||
|
|
||||||
private Context context;
|
private Context context;
|
||||||
private List<Notification> notifications;
|
private final List<Notification> notifications;
|
||||||
|
|
||||||
public PeertubeNotificationsListAdapter(List<Notification> notifications) {
|
public PeertubeNotificationsListAdapter(List<Notification> notifications) {
|
||||||
this.notifications = notifications;
|
this.notifications = notifications;
|
||||||
@ -68,7 +68,7 @@ public class PeertubeNotificationsListAdapter extends RecyclerView.Adapter<Recyc
|
|||||||
Notification notification = notifications.get(position);
|
Notification notification = notifications.get(position);
|
||||||
//Follow Notification
|
//Follow Notification
|
||||||
|
|
||||||
|
holder.peertube_notif_pp.setVisibility(View.VISIBLE);
|
||||||
AccountData.Account accountAction = null;
|
AccountData.Account accountAction = null;
|
||||||
ChannelData.Channel channelAction = null;
|
ChannelData.Channel channelAction = null;
|
||||||
if (notification.getActorFollow() != null) {
|
if (notification.getActorFollow() != null) {
|
||||||
@ -77,7 +77,7 @@ public class PeertubeNotificationsListAdapter extends RecyclerView.Adapter<Recyc
|
|||||||
Actor accountActionFollow = notification.getActorFollow().getFollower();
|
Actor accountActionFollow = notification.getActorFollow().getFollower();
|
||||||
String type = notification.getActorFollow().getFollowing().getType();
|
String type = notification.getActorFollow().getFollowing().getType();
|
||||||
String message;
|
String message;
|
||||||
if (type != null && type.equals("account")) {
|
if (type != null && type.compareTo("channel") == 0) {
|
||||||
message = context.getString(R.string.peertube_follow_channel, notification.getActorFollow().getFollower().getDisplayName(), notification.getActorFollow().getFollowing().getDisplayName());
|
message = context.getString(R.string.peertube_follow_channel, notification.getActorFollow().getFollower().getDisplayName(), notification.getActorFollow().getFollowing().getDisplayName());
|
||||||
} else {
|
} else {
|
||||||
message = context.getString(R.string.peertube_follow_account, accountActionFollow.getDisplayName());
|
message = context.getString(R.string.peertube_follow_account, accountActionFollow.getDisplayName());
|
||||||
@ -86,13 +86,12 @@ public class PeertubeNotificationsListAdapter extends RecyclerView.Adapter<Recyc
|
|||||||
holder.peertube_notif_message.setText(Html.fromHtml(message, Html.FROM_HTML_MODE_LEGACY));
|
holder.peertube_notif_message.setText(Html.fromHtml(message, Html.FROM_HTML_MODE_LEGACY));
|
||||||
else
|
else
|
||||||
holder.peertube_notif_message.setText(Html.fromHtml(message));
|
holder.peertube_notif_message.setText(Html.fromHtml(message));
|
||||||
holder.peertube_notif_pp.setOnClickListener(v -> {
|
Actor actor = notification.getActorFollow().getFollower();
|
||||||
Intent intent = new Intent(context, ShowChannelActivity.class);
|
accountAction = new AccountData.Account();
|
||||||
Bundle b = new Bundle();
|
accountAction.setAvatar(actor.getAvatar());
|
||||||
b.putString("channelId", accountActionFollow.getName() + "@" + accountActionFollow.getHost());
|
accountAction.setDisplayName(actor.getDisplayName());
|
||||||
intent.putExtras(b);
|
accountAction.setHost(actor.getHost());
|
||||||
context.startActivity(intent);
|
accountAction.setUsername(actor.getName());
|
||||||
});
|
|
||||||
} else if (notification.getComment() != null) { //Comment Notification
|
} else if (notification.getComment() != null) { //Comment Notification
|
||||||
String profileUrl = notification.getComment().getAccount().getAvatar() != null ? notification.getComment().getAccount().getAvatar().getPath() : null;
|
String profileUrl = notification.getComment().getAccount().getAvatar() != null ? notification.getComment().getAccount().getAvatar().getPath() : null;
|
||||||
Helper.loadGiF(context, profileUrl, holder.peertube_notif_pp);
|
Helper.loadGiF(context, profileUrl, holder.peertube_notif_pp);
|
||||||
@ -117,22 +116,26 @@ public class PeertubeNotificationsListAdapter extends RecyclerView.Adapter<Recyc
|
|||||||
} else {
|
} else {
|
||||||
String profileUrl = notification.getVideo() != null && notification.getVideo().getChannel().getAvatar() != null ? notification.getVideo().getChannel().getAvatar().getPath() : null;
|
String profileUrl = notification.getVideo() != null && notification.getVideo().getChannel().getAvatar() != null ? notification.getVideo().getChannel().getAvatar().getPath() : null;
|
||||||
Helper.loadGiF(context, profileUrl, holder.peertube_notif_pp);
|
Helper.loadGiF(context, profileUrl, holder.peertube_notif_pp);
|
||||||
|
|
||||||
|
|
||||||
String message = "";
|
String message = "";
|
||||||
|
boolean myVideo = false;
|
||||||
|
holder.peertube_notif_pp.setVisibility(View.INVISIBLE);
|
||||||
if (notification.getVideo() != null) {
|
if (notification.getVideo() != null) {
|
||||||
|
|
||||||
if (notification.getType() == DisplayNotificationsFragment.MY_VIDEO_PUBLISHED) {
|
if (notification.getType() == DisplayNotificationsFragment.MY_VIDEO_PUBLISHED) {
|
||||||
message = context.getString(R.string.peertube_video_published, notification.getVideo().getName());
|
message = context.getString(R.string.peertube_video_published, notification.getVideo().getName());
|
||||||
|
myVideo = true;
|
||||||
} else if (notification.getType() == DisplayNotificationsFragment.MY_VIDEO_IMPORT_ERROR) {
|
} else if (notification.getType() == DisplayNotificationsFragment.MY_VIDEO_IMPORT_ERROR) {
|
||||||
message = context.getString(R.string.peertube_video_import_error, notification.getVideo().getName());
|
message = context.getString(R.string.peertube_video_import_error, notification.getVideo().getName());
|
||||||
|
myVideo = true;
|
||||||
} else if (notification.getType() == DisplayNotificationsFragment.MY_VIDEO_IMPORT_SUCCESS) {
|
} else if (notification.getType() == DisplayNotificationsFragment.MY_VIDEO_IMPORT_SUCCESS) {
|
||||||
message = context.getString(R.string.peertube_video_import_success, notification.getVideo().getName());
|
message = context.getString(R.string.peertube_video_import_success, notification.getVideo().getName());
|
||||||
|
myVideo = true;
|
||||||
} else if (notification.getType() == DisplayNotificationsFragment.NEW_VIDEO_FROM_SUBSCRIPTION) {
|
} else if (notification.getType() == DisplayNotificationsFragment.NEW_VIDEO_FROM_SUBSCRIPTION) {
|
||||||
channelAction = notification.getVideo().getChannel();
|
channelAction = notification.getVideo().getChannel();
|
||||||
message = context.getString(R.string.peertube_video_from_subscription, channelAction.getDisplayName(), notification.getVideo().getName());
|
message = context.getString(R.string.peertube_video_from_subscription, channelAction.getDisplayName(), notification.getVideo().getName());
|
||||||
|
holder.peertube_notif_pp.setVisibility(View.VISIBLE);
|
||||||
} else if (notification.getType() == DisplayNotificationsFragment.BLACKLIST_ON_MY_VIDEO) {
|
} else if (notification.getType() == DisplayNotificationsFragment.BLACKLIST_ON_MY_VIDEO) {
|
||||||
message = context.getString(R.string.peertube_video_blacklist, notification.getVideo().getName());
|
message = context.getString(R.string.peertube_video_blacklist, notification.getVideo().getName());
|
||||||
|
|
||||||
} else if (notification.getType() == DisplayNotificationsFragment.UNBLACKLIST_ON_MY_VIDEO) {
|
} else if (notification.getType() == DisplayNotificationsFragment.UNBLACKLIST_ON_MY_VIDEO) {
|
||||||
message = context.getString(R.string.peertube_video_unblacklist, notification.getVideo().getName());
|
message = context.getString(R.string.peertube_video_unblacklist, notification.getVideo().getName());
|
||||||
}
|
}
|
||||||
@ -140,11 +143,13 @@ public class PeertubeNotificationsListAdapter extends RecyclerView.Adapter<Recyc
|
|||||||
holder.peertube_notif_message.setText(Html.fromHtml(message, Html.FROM_HTML_MODE_LEGACY));
|
holder.peertube_notif_message.setText(Html.fromHtml(message, Html.FROM_HTML_MODE_LEGACY));
|
||||||
else
|
else
|
||||||
holder.peertube_notif_message.setText(Html.fromHtml(message));
|
holder.peertube_notif_message.setText(Html.fromHtml(message));
|
||||||
|
boolean finalMyVideo = myVideo;
|
||||||
holder.peertube_notif_message.setOnClickListener(v -> {
|
holder.peertube_notif_message.setOnClickListener(v -> {
|
||||||
Intent intent = new Intent(context, PeertubeActivity.class);
|
Intent intent = new Intent(context, PeertubeActivity.class);
|
||||||
Bundle b = new Bundle();
|
Bundle b = new Bundle();
|
||||||
b.putParcelable("video", notification.getVideo());
|
b.putParcelable("video", notification.getVideo());
|
||||||
b.putString("peertube_instance", Helper.getLiveInstance(context));
|
b.putString("peertube_instance", Helper.getLiveInstance(context));
|
||||||
|
b.putBoolean("isMyVideo", finalMyVideo);
|
||||||
b.putString("video_id", notification.getVideo().getId());
|
b.putString("video_id", notification.getVideo().getId());
|
||||||
b.putString("video_uuid", notification.getVideo().getUuid());
|
b.putString("video_uuid", notification.getVideo().getUuid());
|
||||||
intent.putExtras(b);
|
intent.putExtras(b);
|
||||||
@ -156,10 +161,17 @@ public class PeertubeNotificationsListAdapter extends RecyclerView.Adapter<Recyc
|
|||||||
holder.peertube_notif_message.setText(Html.fromHtml(message, Html.FROM_HTML_MODE_LEGACY));
|
holder.peertube_notif_message.setText(Html.fromHtml(message, Html.FROM_HTML_MODE_LEGACY));
|
||||||
else
|
else
|
||||||
holder.peertube_notif_message.setText(Html.fromHtml(message));
|
holder.peertube_notif_message.setText(Html.fromHtml(message));
|
||||||
|
}else if (notification.getAbuse() != null){
|
||||||
|
if (notification.getType() == DisplayNotificationsFragment.MY_VIDEO_REPPORT_SUCCESS) {
|
||||||
|
message = context.getString(R.string.peertube_video_report_success, notification.getAbuse().getId());
|
||||||
|
}
|
||||||
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N)
|
||||||
|
holder.peertube_notif_message.setText(Html.fromHtml(message, Html.FROM_HTML_MODE_LEGACY));
|
||||||
|
else
|
||||||
|
holder.peertube_notif_message.setText(Html.fromHtml(message));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
holder.peertube_notif_date.setText(Helper.dateDiff(context, notification.getCreatedAt()));
|
holder.peertube_notif_date.setText(Helper.dateDiff(context, notification.getCreatedAt()));
|
||||||
|
|
||||||
AccountData.Account finalAccountAction = accountAction;
|
AccountData.Account finalAccountAction = accountAction;
|
||||||
ChannelData.Channel finalChannelAction = channelAction;
|
ChannelData.Channel finalChannelAction = channelAction;
|
||||||
holder.peertube_notif_pp.setOnClickListener(v -> {
|
holder.peertube_notif_pp.setOnClickListener(v -> {
|
||||||
@ -167,7 +179,8 @@ public class PeertubeNotificationsListAdapter extends RecyclerView.Adapter<Recyc
|
|||||||
Intent intent = null;
|
Intent intent = null;
|
||||||
if (finalAccountAction != null) {
|
if (finalAccountAction != null) {
|
||||||
intent = new Intent(context, ShowAccountActivity.class);
|
intent = new Intent(context, ShowAccountActivity.class);
|
||||||
b.putString("channel", finalAccountAction.getAcct());
|
b.putParcelable("account", finalAccountAction);
|
||||||
|
b.putString("accountAcct", finalAccountAction.getUsername()+"@"+finalAccountAction.getHost());
|
||||||
} else if (finalChannelAction != null) {
|
} else if (finalChannelAction != null) {
|
||||||
intent = new Intent(context, ShowChannelActivity.class);
|
intent = new Intent(context, ShowChannelActivity.class);
|
||||||
b.putParcelable("channel", finalChannelAction);
|
b.putParcelable("channel", finalChannelAction);
|
||||||
|
@ -67,6 +67,7 @@ public class DisplayChannelsFragment extends Fragment implements ChannelListAdap
|
|||||||
private RecyclerView lv_channels;
|
private RecyclerView lv_channels;
|
||||||
private View rootView;
|
private View rootView;
|
||||||
private FloatingActionButton action_button;
|
private FloatingActionButton action_button;
|
||||||
|
private boolean myChannels;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
|
public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
|
||||||
@ -76,8 +77,10 @@ public class DisplayChannelsFragment extends Fragment implements ChannelListAdap
|
|||||||
context = getContext();
|
context = getContext();
|
||||||
Bundle bundle = this.getArguments();
|
Bundle bundle = this.getArguments();
|
||||||
channels = new ArrayList<>();
|
channels = new ArrayList<>();
|
||||||
|
myChannels = true;
|
||||||
if (bundle != null) {
|
if (bundle != null) {
|
||||||
name = bundle.getString("name", null);
|
name = bundle.getString("name", null);
|
||||||
|
myChannels = bundle.getBoolean("myChannels", true);
|
||||||
}
|
}
|
||||||
|
|
||||||
swiped = false;
|
swiped = false;
|
||||||
@ -86,9 +89,11 @@ public class DisplayChannelsFragment extends Fragment implements ChannelListAdap
|
|||||||
|
|
||||||
if (getActivity() != null) {
|
if (getActivity() != null) {
|
||||||
action_button = getActivity().findViewById(R.id.action_button);
|
action_button = getActivity().findViewById(R.id.action_button);
|
||||||
|
if( action_button != null) {
|
||||||
action_button.setVisibility(View.VISIBLE);
|
action_button.setVisibility(View.VISIBLE);
|
||||||
action_button.setOnClickListener(view -> manageAlert(null));
|
action_button.setOnClickListener(view -> manageAlert(null));
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
lv_channels = rootView.findViewById(R.id.lv_elements);
|
lv_channels = rootView.findViewById(R.id.lv_elements);
|
||||||
lv_channels.addItemDecoration(new DividerItemDecoration(context, DividerItemDecoration.VERTICAL));
|
lv_channels.addItemDecoration(new DividerItemDecoration(context, DividerItemDecoration.VERTICAL));
|
||||||
@ -97,7 +102,7 @@ public class DisplayChannelsFragment extends Fragment implements ChannelListAdap
|
|||||||
textviewNoAction = rootView.findViewById(R.id.no_action);
|
textviewNoAction = rootView.findViewById(R.id.no_action);
|
||||||
mainLoader.setVisibility(View.VISIBLE);
|
mainLoader.setVisibility(View.VISIBLE);
|
||||||
nextElementLoader.setVisibility(View.GONE);
|
nextElementLoader.setVisibility(View.GONE);
|
||||||
channelListAdapter = new ChannelListAdapter(this.channels);
|
channelListAdapter = new ChannelListAdapter(this.channels, myChannels);
|
||||||
channelListAdapter.allChannelRemoved = this;
|
channelListAdapter.allChannelRemoved = this;
|
||||||
channelListAdapter.editAlertDialog = this;
|
channelListAdapter.editAlertDialog = this;
|
||||||
lv_channels.setAdapter(channelListAdapter);
|
lv_channels.setAdapter(channelListAdapter);
|
||||||
@ -170,7 +175,7 @@ public class DisplayChannelsFragment extends Fragment implements ChannelListAdap
|
|||||||
textviewNoAction.setVisibility(View.GONE);
|
textviewNoAction.setVisibility(View.GONE);
|
||||||
|
|
||||||
if (swiped) {
|
if (swiped) {
|
||||||
channelListAdapter = new ChannelListAdapter(this.channels);
|
channelListAdapter = new ChannelListAdapter(this.channels, myChannels);
|
||||||
channelListAdapter.allChannelRemoved = DisplayChannelsFragment.this;
|
channelListAdapter.allChannelRemoved = DisplayChannelsFragment.this;
|
||||||
channelListAdapter.editAlertDialog = DisplayChannelsFragment.this;
|
channelListAdapter.editAlertDialog = DisplayChannelsFragment.this;
|
||||||
lv_channels.setAdapter(channelListAdapter);
|
lv_channels.setAdapter(channelListAdapter);
|
||||||
@ -267,12 +272,16 @@ public class DisplayChannelsFragment extends Fragment implements ChannelListAdap
|
|||||||
}
|
}
|
||||||
channelListAdapter.notifyItemChanged(position);
|
channelListAdapter.notifyItemChanged(position);
|
||||||
}
|
}
|
||||||
|
if( action_button != null) {
|
||||||
action_button.setEnabled(true);
|
action_button.setEnabled(true);
|
||||||
|
}
|
||||||
};
|
};
|
||||||
mainHandler.post(myRunnable);
|
mainHandler.post(myRunnable);
|
||||||
}).start();
|
}).start();
|
||||||
alertDialog.dismiss();
|
alertDialog.dismiss();
|
||||||
|
if( action_button != null) {
|
||||||
action_button.setEnabled(false);
|
action_button.setEnabled(false);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
Toasty.error(context, context.getString(R.string.error_display_name_channel), Toast.LENGTH_LONG).show();
|
Toasty.error(context, context.getString(R.string.error_display_name_channel), Toast.LENGTH_LONG).show();
|
||||||
}
|
}
|
||||||
|
@ -47,11 +47,12 @@ public class DisplayNotificationsFragment extends Fragment {
|
|||||||
|
|
||||||
//Peertube notification type
|
//Peertube notification type
|
||||||
public static int NEW_VIDEO_FROM_SUBSCRIPTION = 1;
|
public static int NEW_VIDEO_FROM_SUBSCRIPTION = 1;
|
||||||
public static int BLACKLIST_ON_MY_VIDEO = 4;
|
|
||||||
public static int UNBLACKLIST_ON_MY_VIDEO = 5;
|
public static int UNBLACKLIST_ON_MY_VIDEO = 5;
|
||||||
|
public static int BLACKLIST_ON_MY_VIDEO = 4;
|
||||||
public static int MY_VIDEO_PUBLISHED = 6;
|
public static int MY_VIDEO_PUBLISHED = 6;
|
||||||
public static int MY_VIDEO_IMPORT_SUCCESS = 7;
|
public static int MY_VIDEO_IMPORT_SUCCESS = 7;
|
||||||
public static int MY_VIDEO_IMPORT_ERROR = 8;
|
public static int MY_VIDEO_IMPORT_ERROR = 8;
|
||||||
|
public static int MY_VIDEO_REPPORT_SUCCESS = 15;
|
||||||
private boolean flag_loading;
|
private boolean flag_loading;
|
||||||
private Context context;
|
private Context context;
|
||||||
private PeertubeNotificationsListAdapter peertubeNotificationsListAdapter;
|
private PeertubeNotificationsListAdapter peertubeNotificationsListAdapter;
|
||||||
|
@ -121,7 +121,7 @@ public class DisplayVideosFragment extends Fragment implements AccountsHorizonta
|
|||||||
playlistId = bundle.getString("playlistId", null);
|
playlistId = bundle.getString("playlistId", null);
|
||||||
}
|
}
|
||||||
max_id = "0";
|
max_id = "0";
|
||||||
forAccount = null;
|
forAccount = type== TimelineVM.TimelineType.ACCOUNT_VIDEOS?channelId: null;
|
||||||
lv_status = rootView.findViewById(R.id.lv_status);
|
lv_status = rootView.findViewById(R.id.lv_status);
|
||||||
RecyclerView lv_accounts = rootView.findViewById(R.id.lv_accounts);
|
RecyclerView lv_accounts = rootView.findViewById(R.id.lv_accounts);
|
||||||
Button display_all = rootView.findViewById(R.id.display_all);
|
Button display_all = rootView.findViewById(R.id.display_all);
|
||||||
@ -497,7 +497,7 @@ public class DisplayVideosFragment extends Fragment implements AccountsHorizonta
|
|||||||
*/
|
*/
|
||||||
private void loadTimeline(String max_id) {
|
private void loadTimeline(String max_id) {
|
||||||
if (search_peertube == null) { //Not a Peertube search
|
if (search_peertube == null) { //Not a Peertube search
|
||||||
if (type == TimelineVM.TimelineType.USER_VIDEOS) {
|
if (type == TimelineVM.TimelineType.CHANNEL_VIDEOS) {
|
||||||
viewModelFeeds.getVideosInChannel(sepiaSearch?remoteInstance:null, channelId, max_id).observe(this.requireActivity(), this::manageVIewVideos);
|
viewModelFeeds.getVideosInChannel(sepiaSearch?remoteInstance:null, channelId, max_id).observe(this.requireActivity(), this::manageVIewVideos);
|
||||||
} else if (type == TimelineVM.TimelineType.VIDEOS_IN_PLAYLIST) {
|
} else if (type == TimelineVM.TimelineType.VIDEOS_IN_PLAYLIST) {
|
||||||
viewModelFeeds.loadVideosInPlaylist(playlistId, max_id).observe(this.requireActivity(), this::manageVIewVideos);
|
viewModelFeeds.loadVideosInPlaylist(playlistId, max_id).observe(this.requireActivity(), this::manageVIewVideos);
|
||||||
@ -523,9 +523,9 @@ public class DisplayVideosFragment extends Fragment implements AccountsHorizonta
|
|||||||
|
|
||||||
static class GridSpacingItemDecoration extends RecyclerView.ItemDecoration {
|
static class GridSpacingItemDecoration extends RecyclerView.ItemDecoration {
|
||||||
|
|
||||||
private int spanCount;
|
private final int spanCount;
|
||||||
private int spacing;
|
private final int spacing;
|
||||||
private boolean includeEdge;
|
private final boolean includeEdge;
|
||||||
|
|
||||||
public GridSpacingItemDecoration(int spanCount, int spacing, boolean includeEdge) {
|
public GridSpacingItemDecoration(int spanCount, int spacing, boolean includeEdge) {
|
||||||
this.spanCount = spanCount;
|
this.spanCount = spanCount;
|
||||||
|
@ -0,0 +1,78 @@
|
|||||||
|
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 java.io.BufferedReader;
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.io.InputStreamReader;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.regex.Matcher;
|
||||||
|
import java.util.regex.Pattern;
|
||||||
|
|
||||||
|
public class EmojiHelper {
|
||||||
|
|
||||||
|
|
||||||
|
//Emoji manager
|
||||||
|
private static final Map<String, String> emoji = new HashMap<>();
|
||||||
|
private static final Pattern SHORTNAME_PATTERN = Pattern.compile(":( |)([-+\\w]+):");
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Converts emojis in input to unicode
|
||||||
|
* @param input String
|
||||||
|
* @return String
|
||||||
|
*/
|
||||||
|
public static String shortnameToUnicode(String input) {
|
||||||
|
Matcher matcher = SHORTNAME_PATTERN.matcher(input);
|
||||||
|
|
||||||
|
while (matcher.find()) {
|
||||||
|
String unicode = emoji.get(matcher.group(2));
|
||||||
|
if (unicode == null) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
if (matcher.group(1).equals(" "))
|
||||||
|
input = input.replace(": " + matcher.group(2) + ":", unicode);
|
||||||
|
else
|
||||||
|
input = input.replace(":" + matcher.group(2) + ":", unicode);
|
||||||
|
}
|
||||||
|
return input;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
public static void fillMapEmoji(Context context) {
|
||||||
|
try {
|
||||||
|
BufferedReader br = new BufferedReader(new InputStreamReader(context.getAssets().open("emoji.csv")));
|
||||||
|
String line;
|
||||||
|
while( (line = br.readLine()) != null) {
|
||||||
|
String[] str = line.split(",");
|
||||||
|
String unicode = null;
|
||||||
|
if(str.length == 2)
|
||||||
|
unicode = new String(new int[] {Integer.parseInt(str[1].replace("0x","").trim(), 16)}, 0, 1);
|
||||||
|
else if(str.length == 3)
|
||||||
|
unicode = new String(new int[] {Integer.parseInt(str[1].replace("0x","").trim(), 16), Integer.parseInt(str[2].replace("0x","").trim(), 16)}, 0, 2);
|
||||||
|
else if(str.length == 4)
|
||||||
|
unicode = new String(new int[] {Integer.parseInt(str[1].replace("0x","").trim(), 16), Integer.parseInt(str[2].replace("0x","").trim(), 16), Integer.parseInt(str[3].replace("0x","").trim(), 16)}, 0, 3);
|
||||||
|
else if(str.length == 5)
|
||||||
|
unicode = new String(new int[] {Integer.parseInt(str[1].replace("0x","").trim(), 16), Integer.parseInt(str[2].replace("0x","").trim(), 16), Integer.parseInt(str[3].replace("0x","").trim(), 16), Integer.parseInt(str[4].replace("0x","").trim(), 16)}, 0, 4);
|
||||||
|
if( unicode != null)
|
||||||
|
emoji.put(str[0],unicode);
|
||||||
|
}
|
||||||
|
br.close();
|
||||||
|
} catch (IOException ignored) {ignored.printStackTrace();}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
@ -23,6 +23,8 @@ import android.widget.Button;
|
|||||||
import android.widget.ImageButton;
|
import android.widget.ImageButton;
|
||||||
import android.widget.MediaController;
|
import android.widget.MediaController;
|
||||||
|
|
||||||
|
import androidx.core.content.res.ResourcesCompat;
|
||||||
|
|
||||||
import app.fedilab.fedilabtube.PeertubeActivity;
|
import app.fedilab.fedilabtube.PeertubeActivity;
|
||||||
import app.fedilab.fedilabtube.R;
|
import app.fedilab.fedilabtube.R;
|
||||||
import app.fedilab.fedilabtube.client.data.VideoData.Video;
|
import app.fedilab.fedilabtube.client.data.VideoData.Video;
|
||||||
@ -36,7 +38,7 @@ public class FullScreenMediaController extends MediaController {
|
|||||||
|
|
||||||
private ImageButton fullScreen;
|
private ImageButton fullScreen;
|
||||||
private Button resolution;
|
private Button resolution;
|
||||||
private Context context;
|
private final Context context;
|
||||||
private Video peertube;
|
private Video peertube;
|
||||||
private String resolutionVal;
|
private String resolutionVal;
|
||||||
|
|
||||||
@ -85,12 +87,11 @@ public class FullScreenMediaController extends MediaController {
|
|||||||
|
|
||||||
if (((PeertubeActivity) getContext()).getFullscreen() == fullscreen.ON) {
|
if (((PeertubeActivity) getContext()).getFullscreen() == fullscreen.ON) {
|
||||||
Resources resources = getResources();
|
Resources resources = getResources();
|
||||||
fullScreen.setImageDrawable(resources.getDrawable(R.drawable.ic_baseline_fullscreen_exit_24));
|
fullScreen.setImageDrawable(ResourcesCompat.getDrawable(resources, R.drawable.ic_baseline_fullscreen_exit_24, null));
|
||||||
} else {
|
} else {
|
||||||
Resources resources = getResources();
|
Resources resources = getResources();
|
||||||
fullScreen.setImageDrawable(resources.getDrawable(R.drawable.ic_baseline_fullscreen_24));
|
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
|
//add listener to image button to handle full screen and exit full screen events
|
||||||
fullScreen.setOnClickListener(v -> {
|
fullScreen.setOnClickListener(v -> {
|
||||||
|
|
||||||
@ -115,10 +116,10 @@ public class FullScreenMediaController extends MediaController {
|
|||||||
//fullscreen indicator from intent
|
//fullscreen indicator from intent
|
||||||
if (((PeertubeActivity) getContext()).getFullscreen() == fullscreen.ON) {
|
if (((PeertubeActivity) getContext()).getFullscreen() == fullscreen.ON) {
|
||||||
Resources resources = getResources();
|
Resources resources = getResources();
|
||||||
fullScreen.setImageDrawable(resources.getDrawable(R.drawable.ic_baseline_fullscreen_exit_24));
|
fullScreen.setImageDrawable(ResourcesCompat.getDrawable(resources, R.drawable.ic_baseline_fullscreen_exit_24, null));
|
||||||
} else {
|
} else {
|
||||||
Resources resources = getResources();
|
Resources resources = getResources();
|
||||||
fullScreen.setImageDrawable(resources.getDrawable(R.drawable.ic_baseline_fullscreen_24));
|
fullScreen.setImageDrawable(ResourcesCompat.getDrawable(resources, R.drawable.ic_baseline_fullscreen_24, null));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -58,6 +58,7 @@ import app.fedilab.fedilabtube.MainActivity;
|
|||||||
import app.fedilab.fedilabtube.R;
|
import app.fedilab.fedilabtube.R;
|
||||||
import app.fedilab.fedilabtube.WebviewActivity;
|
import app.fedilab.fedilabtube.WebviewActivity;
|
||||||
import app.fedilab.fedilabtube.client.data.AccountData.Account;
|
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.data.VideoData;
|
||||||
import app.fedilab.fedilabtube.client.entities.File;
|
import app.fedilab.fedilabtube.client.entities.File;
|
||||||
import app.fedilab.fedilabtube.sqlite.AccountDAO;
|
import app.fedilab.fedilabtube.sqlite.AccountDAO;
|
||||||
@ -239,7 +240,7 @@ public class Helper {
|
|||||||
final SharedPreferences sharedpreferences = context.getSharedPreferences(Helper.APP_PREFS, Context.MODE_PRIVATE);
|
final SharedPreferences sharedpreferences = context.getSharedPreferences(Helper.APP_PREFS, Context.MODE_PRIVATE);
|
||||||
String acad;
|
String acad;
|
||||||
if (BuildConfig.full_instances) {
|
if (BuildConfig.full_instances) {
|
||||||
return sharedpreferences.getString(Helper.PREF_INSTANCE, "peertube.social");
|
return sharedpreferences.getString(Helper.PREF_INSTANCE, getDefaultInstance());
|
||||||
} else {
|
} else {
|
||||||
acad = sharedpreferences.getString(Helper.PREF_INSTANCE, "tube.ac-lyon.fr");
|
acad = sharedpreferences.getString(Helper.PREF_INSTANCE, "tube.ac-lyon.fr");
|
||||||
if (acad == null) {
|
if (acad == null) {
|
||||||
@ -253,6 +254,49 @@ public class Helper {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get a default instance host name depending of the device locale
|
||||||
|
* @return peertube host String
|
||||||
|
*/
|
||||||
|
private static String getDefaultInstance() {
|
||||||
|
String lang = Locale.getDefault().getLanguage();
|
||||||
|
if (lang.contains("-")) {
|
||||||
|
if (!lang.split("-")[0].trim().toLowerCase().startsWith("zh")) {
|
||||||
|
lang = lang.split("-")[0];
|
||||||
|
if(lang.split("-")[1].toLowerCase().contains("be")){
|
||||||
|
lang = "be";
|
||||||
|
}
|
||||||
|
else if(lang.split("-")[1].toLowerCase().contains("gb")){
|
||||||
|
lang = "gb";
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
lang = lang.split("-")[0] + "-" + lang.split("-")[1].toUpperCase();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
switch (lang){
|
||||||
|
case "it":
|
||||||
|
return "peertube.uno";
|
||||||
|
case "be":
|
||||||
|
return "peertube.be";
|
||||||
|
case "fr":
|
||||||
|
return "video.liberta.vip";
|
||||||
|
case "de":
|
||||||
|
return "peertube.at";
|
||||||
|
case "ru":
|
||||||
|
return "peertube.su";
|
||||||
|
case "gb":
|
||||||
|
return "peertube.co.uk";
|
||||||
|
case "da":
|
||||||
|
case "sv":
|
||||||
|
case "nb":
|
||||||
|
case "fi":
|
||||||
|
case "is":
|
||||||
|
return "peertube.dk";
|
||||||
|
default:
|
||||||
|
return "peertube.social";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Convert a date in String -> format yyyy-MM-dd HH:mm:ss
|
* Convert a date in String -> format yyyy-MM-dd HH:mm:ss
|
||||||
*
|
*
|
||||||
@ -292,6 +336,11 @@ public class Helper {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Convert second to String formated date
|
||||||
|
* @param pTime timestamp
|
||||||
|
* @return String formatted value
|
||||||
|
*/
|
||||||
public static String secondsToString(int pTime) {
|
public static String secondsToString(int pTime) {
|
||||||
|
|
||||||
int hour = pTime / 3600;
|
int hour = pTime / 3600;
|
||||||
@ -352,6 +401,11 @@ public class Helper {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Return rounded numbers depending of the value
|
||||||
|
* @param count long
|
||||||
|
* @return String rounded value to be displayed
|
||||||
|
*/
|
||||||
public static String withSuffix(long count) {
|
public static String withSuffix(long count) {
|
||||||
if (count < 1000) return "" + count;
|
if (count < 1000) return "" + count;
|
||||||
int exp = (int) (Math.log(count) / Math.log(1000));
|
int exp = (int) (Math.log(count) / Math.log(1000));
|
||||||
@ -380,12 +434,12 @@ public class Helper {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static void loadGiF(final Context context, String url, final ImageView imageView, int round) {
|
public static void loadGiF(final Context context, String url, final ImageView imageView, int round) {
|
||||||
loadGif(context, null, url, imageView, 10);
|
loadGif(context, null, url, imageView, round);
|
||||||
}
|
}
|
||||||
|
|
||||||
@SuppressWarnings("SameParameterValue")
|
@SuppressWarnings("SameParameterValue")
|
||||||
private static void loadGif(final Context context, String instance, String url, final ImageView imageView, int round) {
|
private static void loadGif(final Context context, String instance, String url, final ImageView imageView, int round) {
|
||||||
if (url == null || url.trim().toLowerCase().compareTo("null") == 0) {
|
if (url == null || url.trim().toLowerCase().compareTo("null") == 0 || url.endsWith("null")) {
|
||||||
Glide.with(imageView.getContext())
|
Glide.with(imageView.getContext())
|
||||||
.asDrawable()
|
.asDrawable()
|
||||||
.load(R.drawable.missing_peertube)
|
.load(R.drawable.missing_peertube)
|
||||||
@ -419,6 +473,13 @@ public class Helper {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Initialize the webview
|
||||||
|
* @param activity Current Activity
|
||||||
|
* @param webviewId int id of the webview layout
|
||||||
|
* @param rootView View the root view
|
||||||
|
* @return CustomWebview
|
||||||
|
*/
|
||||||
@SuppressLint("SetJavaScriptEnabled")
|
@SuppressLint("SetJavaScriptEnabled")
|
||||||
public static CustomWebview initializeWebview(Activity activity, int webviewId, View rootView) {
|
public static CustomWebview initializeWebview(Activity activity, int webviewId, View rootView) {
|
||||||
|
|
||||||
@ -598,8 +659,11 @@ public class Helper {
|
|||||||
String userName = sharedpreferences.getString(Helper.PREF_KEY_NAME, "");
|
String userName = sharedpreferences.getString(Helper.PREF_KEY_NAME, "");
|
||||||
String instance = sharedpreferences.getString(Helper.PREF_INSTANCE, "");
|
String instance = sharedpreferences.getString(Helper.PREF_INSTANCE, "");
|
||||||
Account account = video.getAccount();
|
Account account = video.getAccount();
|
||||||
if (instance != null && userName != null) {
|
ChannelData.Channel channel = video.getChannel();
|
||||||
|
if (account != null && instance != null && userName != null) {
|
||||||
return account.getUsername().compareTo(userName) == 0 && account.getHost().compareTo(instance) == 0;
|
return account.getUsername().compareTo(userName) == 0 && account.getHost().compareTo(instance) == 0;
|
||||||
|
} else if (channel != null && instance != null && userName != null) {
|
||||||
|
return channel.getName().compareTo(userName) == 0 && channel.getHost().compareTo(instance) == 0;
|
||||||
} else {
|
} else {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -12,8 +12,8 @@ import app.fedilab.fedilabtube.R;
|
|||||||
|
|
||||||
public class RoundedBackgroundSpan extends ReplacementSpan {
|
public class RoundedBackgroundSpan extends ReplacementSpan {
|
||||||
|
|
||||||
private int backgroundColor;
|
private final int backgroundColor;
|
||||||
private int textColor;
|
private final int textColor;
|
||||||
|
|
||||||
public RoundedBackgroundSpan(Context context) {
|
public RoundedBackgroundSpan(Context context) {
|
||||||
super();
|
super();
|
||||||
|
@ -33,6 +33,7 @@ import java.util.Objects;
|
|||||||
import app.fedilab.fedilabtube.R;
|
import app.fedilab.fedilabtube.R;
|
||||||
import app.fedilab.fedilabtube.client.RetrofitPeertubeAPI;
|
import app.fedilab.fedilabtube.client.RetrofitPeertubeAPI;
|
||||||
import app.fedilab.fedilabtube.client.entities.PeertubeInformation;
|
import app.fedilab.fedilabtube.client.entities.PeertubeInformation;
|
||||||
|
import app.fedilab.fedilabtube.helper.EmojiHelper;
|
||||||
import app.fedilab.fedilabtube.helper.NetworkStateReceiver;
|
import app.fedilab.fedilabtube.helper.NetworkStateReceiver;
|
||||||
|
|
||||||
import static app.fedilab.fedilabtube.MainActivity.peertubeInformation;
|
import static app.fedilab.fedilabtube.MainActivity.peertubeInformation;
|
||||||
@ -55,8 +56,6 @@ public class RetrieveInfoService extends Service implements NetworkStateReceiver
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int onStartCommand(Intent intent, int flags, int startId) {
|
public int onStartCommand(Intent intent, int flags, int startId) {
|
||||||
|
|
||||||
|
|
||||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
|
||||||
NotificationChannel channel = new NotificationChannel(NOTIFICATION_CHANNEL_ID,
|
NotificationChannel channel = new NotificationChannel(NOTIFICATION_CHANNEL_ID,
|
||||||
getString(R.string.notification_channel_name),
|
getString(R.string.notification_channel_name),
|
||||||
@ -88,6 +87,7 @@ public class RetrieveInfoService extends Service implements NetworkStateReceiver
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
|
EmojiHelper.fillMapEmoji(getApplicationContext());
|
||||||
peertubeInformation = new PeertubeInformation();
|
peertubeInformation = new PeertubeInformation();
|
||||||
peertubeInformation.setCategories(new LinkedHashMap<>());
|
peertubeInformation.setCategories(new LinkedHashMap<>());
|
||||||
peertubeInformation.setLanguages(new LinkedHashMap<>());
|
peertubeInformation.setLanguages(new LinkedHashMap<>());
|
||||||
@ -97,11 +97,9 @@ public class RetrieveInfoService extends Service implements NetworkStateReceiver
|
|||||||
peertubeInformation.setTranslations(new LinkedHashMap<>());
|
peertubeInformation.setTranslations(new LinkedHashMap<>());
|
||||||
peertubeInformation = new RetrofitPeertubeAPI(RetrieveInfoService.this).getPeertubeInformation();
|
peertubeInformation = new RetrofitPeertubeAPI(RetrieveInfoService.this).getPeertubeInformation();
|
||||||
stopForeground(true);
|
stopForeground(true);
|
||||||
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
thread.start();
|
thread.start();
|
||||||
|
|
||||||
return START_NOT_STICKY;
|
return START_NOT_STICKY;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -128,6 +126,7 @@ public class RetrieveInfoService extends Service implements NetworkStateReceiver
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
|
EmojiHelper.fillMapEmoji(getApplicationContext());
|
||||||
peertubeInformation = new PeertubeInformation();
|
peertubeInformation = new PeertubeInformation();
|
||||||
peertubeInformation.setCategories(new LinkedHashMap<>());
|
peertubeInformation.setCategories(new LinkedHashMap<>());
|
||||||
peertubeInformation.setLanguages(new LinkedHashMap<>());
|
peertubeInformation.setLanguages(new LinkedHashMap<>());
|
||||||
|
@ -34,7 +34,7 @@ import app.fedilab.fedilabtube.helper.Helper;
|
|||||||
public class AccountDAO {
|
public class AccountDAO {
|
||||||
|
|
||||||
public Context context;
|
public Context context;
|
||||||
private SQLiteDatabase db;
|
private final SQLiteDatabase db;
|
||||||
|
|
||||||
|
|
||||||
public AccountDAO(Context context, SQLiteDatabase db) {
|
public AccountDAO(Context context, SQLiteDatabase db) {
|
||||||
|
@ -41,6 +41,12 @@ public class AccountsVM extends AndroidViewModel {
|
|||||||
return apiResponseMutableLiveData;
|
return apiResponseMutableLiveData;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public LiveData<APIResponse> getAccount(String acct) {
|
||||||
|
apiResponseMutableLiveData = new MutableLiveData<>();
|
||||||
|
loadAccount(acct);
|
||||||
|
return apiResponseMutableLiveData;
|
||||||
|
}
|
||||||
|
|
||||||
private void loadAccounts(RetrofitPeertubeAPI.DataType dataType, String element) {
|
private void loadAccounts(RetrofitPeertubeAPI.DataType dataType, String element) {
|
||||||
Context _mContext = getApplication().getApplicationContext();
|
Context _mContext = getApplication().getApplicationContext();
|
||||||
new Thread(() -> {
|
new Thread(() -> {
|
||||||
@ -62,4 +68,18 @@ public class AccountsVM extends AndroidViewModel {
|
|||||||
}).start();
|
}).start();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void loadAccount(String acct) {
|
||||||
|
Context _mContext = getApplication().getApplicationContext();
|
||||||
|
new Thread(() -> {
|
||||||
|
try {
|
||||||
|
RetrofitPeertubeAPI retrofitPeertubeAPI = new RetrofitPeertubeAPI(_mContext);
|
||||||
|
APIResponse apiResponse = retrofitPeertubeAPI.getAccount(acct);
|
||||||
|
Handler mainHandler = new Handler(Looper.getMainLooper());
|
||||||
|
Runnable myRunnable = () -> apiResponseMutableLiveData.setValue(apiResponse);
|
||||||
|
mainHandler.post(myRunnable);
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}).start();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -74,7 +74,7 @@ public class CommentVM extends AndroidViewModel {
|
|||||||
new Thread(() -> {
|
new Thread(() -> {
|
||||||
try {
|
try {
|
||||||
RetrofitPeertubeAPI api = new RetrofitPeertubeAPI(_mContext);
|
RetrofitPeertubeAPI api = new RetrofitPeertubeAPI(_mContext);
|
||||||
APIResponse apiResponse = api.getComments(action.GET_REPLIES, videoId, null, null);
|
APIResponse apiResponse = api.getComments(action.GET_REPLIES, videoId, commentId, null);
|
||||||
Handler mainHandler = new Handler(Looper.getMainLooper());
|
Handler mainHandler = new Handler(Looper.getMainLooper());
|
||||||
Runnable myRunnable = () -> apiResponseMutableLiveData.setValue(apiResponse);
|
Runnable myRunnable = () -> apiResponseMutableLiveData.setValue(apiResponse);
|
||||||
mainHandler.post(myRunnable);
|
mainHandler.post(myRunnable);
|
||||||
|
@ -15,7 +15,6 @@ package app.fedilab.fedilabtube.viewmodel;
|
|||||||
* see <http://www.gnu.org/licenses>. */
|
* see <http://www.gnu.org/licenses>. */
|
||||||
|
|
||||||
import android.app.Application;
|
import android.app.Application;
|
||||||
import android.content.Context;
|
|
||||||
import android.os.Handler;
|
import android.os.Handler;
|
||||||
import android.os.Looper;
|
import android.os.Looper;
|
||||||
|
|
||||||
|
@ -181,7 +181,8 @@ public class TimelineVM extends AndroidViewModel {
|
|||||||
|
|
||||||
|
|
||||||
public enum TimelineType {
|
public enum TimelineType {
|
||||||
USER_VIDEOS,
|
CHANNEL_VIDEOS,
|
||||||
|
ACCOUNT_VIDEOS,
|
||||||
SUBSCRIBTIONS,
|
SUBSCRIBTIONS,
|
||||||
MY_VIDEOS,
|
MY_VIDEOS,
|
||||||
LOCAL,
|
LOCAL,
|
||||||
|
@ -76,14 +76,21 @@
|
|||||||
</RelativeLayout>
|
</RelativeLayout>
|
||||||
</RelativeLayout>
|
</RelativeLayout>
|
||||||
|
|
||||||
<androidx.core.widget.NestedScrollView
|
<androidx.constraintlayout.widget.ConstraintLayout
|
||||||
android:id="@+id/peertube_information_container"
|
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="0dp"
|
android:layout_height="0dp"
|
||||||
|
android:layout_weight="2"
|
||||||
android:layout_marginStart="@dimen/video_comment_margin"
|
android:layout_marginStart="@dimen/video_comment_margin"
|
||||||
android:layout_marginEnd="@dimen/video_comment_margin"
|
android:layout_marginEnd="@dimen/video_comment_margin"
|
||||||
android:layout_weight="2">
|
>
|
||||||
|
<androidx.core.widget.NestedScrollView
|
||||||
|
app:layout_constraintTop_toTopOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
|
android:id="@+id/peertube_information_container"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent">
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
@ -210,70 +217,80 @@
|
|||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginTop="10dp" />
|
android:layout_marginTop="10dp" />
|
||||||
|
|
||||||
<LinearLayout
|
|
||||||
|
<androidx.constraintlayout.widget.ConstraintLayout
|
||||||
android:id="@+id/write_comment_container"
|
android:id="@+id/write_comment_container"
|
||||||
|
android:layout_margin="10dp"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content">
|
||||||
android:layout_gravity="center_vertical"
|
<View
|
||||||
android:layout_marginTop="10dp"
|
android:id="@+id/separator_top"
|
||||||
android:baselineAligned="false"
|
android:layout_margin="5dp"
|
||||||
android:orientation="horizontal"
|
app:layout_constraintTop_toTopOf="parent"
|
||||||
android:visibility="gone">
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
<LinearLayout
|
app:layout_constraintBottom_toTopOf="@+id/write_container"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="1px"
|
||||||
android:orientation="vertical">
|
android:background="@android:color/darker_gray"/>
|
||||||
|
<androidx.constraintlayout.widget.ConstraintLayout
|
||||||
|
app:layout_constraintTop_toBottomOf="@+id/separator_top"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintBottom_toTopOf="@+id/separator_bottom"
|
||||||
|
android:id="@+id/write_container"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content">
|
||||||
<ImageView
|
<ImageView
|
||||||
android:id="@+id/my_pp"
|
android:id="@+id/my_pp"
|
||||||
android:layout_width="40dp"
|
app:layout_constraintTop_toTopOf="parent"
|
||||||
android:layout_height="40dp"
|
android:layout_marginEnd="5dp"
|
||||||
android:contentDescription="@string/profile_picture" />
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
|
||||||
<ImageView
|
|
||||||
android:id="@+id/send"
|
|
||||||
android:layout_width="30dp"
|
android:layout_width="30dp"
|
||||||
android:layout_height="30dp"
|
android:layout_height="30dp"
|
||||||
android:layout_marginTop="5dp"
|
android:contentDescription="@string/profile_picture" />
|
||||||
android:contentDescription="@string/send_comment"
|
<studio.carbonylgroup.textfieldboxes.TextFieldBoxes
|
||||||
android:src="@drawable/ic_baseline_send_24"
|
android:id="@+id/text_field_boxes"
|
||||||
android:visibility="gone" />
|
|
||||||
</LinearLayout>
|
|
||||||
|
|
||||||
<LinearLayout
|
|
||||||
android:layout_width="0dp"
|
android:layout_width="0dp"
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_gravity="center_vertical"
|
|
||||||
android:layout_marginStart="10dp"
|
|
||||||
android:layout_marginTop="5dp"
|
|
||||||
android:layout_marginBottom="5dp"
|
|
||||||
android:layout_weight="1"
|
|
||||||
android:orientation="vertical">
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:id="@+id/add_comment_read"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:text="@string/add_public_comment" />
|
app:layout_constraintTop_toTopOf="parent"
|
||||||
|
app:layout_constraintStart_toEndOf="@+id/my_pp"
|
||||||
<EditText
|
app:layout_constraintEnd_toStartOf="@+id/send"
|
||||||
|
app:labelText="@string/add_public_comment"
|
||||||
|
app:secondaryColor="?attr/colorAccent"
|
||||||
|
app:primaryColor="?attr/colorAccent"
|
||||||
|
>
|
||||||
|
<studio.carbonylgroup.textfieldboxes.ExtendedEditText
|
||||||
android:id="@+id/add_comment_write"
|
android:id="@+id/add_comment_write"
|
||||||
android:layout_width="match_parent"
|
app:alwaysShowHint="false"
|
||||||
|
app:useDenseSpacing="false"
|
||||||
|
android:textSize="14sp"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:focusable="true"
|
/>
|
||||||
android:focusableInTouchMode="true"
|
</studio.carbonylgroup.textfieldboxes.TextFieldBoxes>
|
||||||
android:hint="@string/add_public_comment"
|
<ImageView
|
||||||
android:importantForAutofill="no"
|
android:layout_marginStart="5dp"
|
||||||
android:inputType="textMultiLine"
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
android:maxLines="4"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
android:overScrollMode="always"
|
android:id="@+id/send"
|
||||||
android:scrollbarStyle="insideInset"
|
android:layout_width="wrap_content"
|
||||||
android:scrollbars="vertical"
|
android:layout_height="wrap_content"
|
||||||
android:visibility="gone" />
|
android:contentDescription="@string/send_comment"
|
||||||
</LinearLayout>
|
android:src="@drawable/ic_baseline_send_24" />
|
||||||
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
|
|
||||||
</LinearLayout>
|
<View
|
||||||
|
android:id="@+id/separator_bottom"
|
||||||
|
android:layout_margin="5dp"
|
||||||
|
app:layout_constraintTop_toBottomOf="@+id/write_container"
|
||||||
|
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"/>
|
||||||
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
|
|
||||||
<androidx.recyclerview.widget.RecyclerView
|
<androidx.recyclerview.widget.RecyclerView
|
||||||
android:id="@+id/peertube_comments"
|
android:id="@+id/peertube_comments"
|
||||||
@ -298,6 +315,175 @@
|
|||||||
</RelativeLayout>
|
</RelativeLayout>
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
</androidx.core.widget.NestedScrollView>
|
</androidx.core.widget.NestedScrollView>
|
||||||
|
|
||||||
|
<androidx.core.widget.NestedScrollView
|
||||||
|
android:background="?android:colorBackground"
|
||||||
|
android:visibility="gone"
|
||||||
|
app:layout_constraintTop_toTopOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
|
android:id="@+id/reply_thread"
|
||||||
|
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"
|
||||||
|
android:layout_width="24dp"
|
||||||
|
android:layout_height="24dp"
|
||||||
|
android:contentDescription="@string/close"
|
||||||
|
android:src="@drawable/ic_close_black_48dp"/>
|
||||||
|
<androidx.constraintlayout.widget.ConstraintLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content">
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/comment_account_profile"
|
||||||
|
android:layout_width="40dp"
|
||||||
|
android:layout_height="40dp"
|
||||||
|
android:layout_marginTop="5dp"
|
||||||
|
android:contentDescription="@string/profile_picture"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toTopOf="parent" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/comment_account_displayname"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginStart="5dp"
|
||||||
|
android:singleLine="true"
|
||||||
|
android:textStyle="bold"
|
||||||
|
app:layout_constraintEnd_toStartOf="@+id/comment_date"
|
||||||
|
app:layout_constraintStart_toEndOf="@+id/comment_account_profile"
|
||||||
|
app:layout_constraintTop_toTopOf="parent" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
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:ellipsize="end"
|
||||||
|
android:singleLine="true"
|
||||||
|
android:textSize="12sp"
|
||||||
|
app:layout_constraintStart_toEndOf="@+id/comment_account_profile"
|
||||||
|
app:layout_constraintTop_toBottomOf="@+id/comment_account_displayname" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/comment_date"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_gravity="end"
|
||||||
|
android:layout_marginStart="2dp"
|
||||||
|
android:layout_weight="0"
|
||||||
|
android:gravity="end"
|
||||||
|
android:maxLines="1"
|
||||||
|
android:textSize="12sp"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintTop_toTopOf="parent" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/comment_content"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="5dp"
|
||||||
|
android:textIsSelectable="true"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
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_reply"
|
||||||
|
android:layout_margin="10dp"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content">
|
||||||
|
<View
|
||||||
|
android:id="@+id/separator_top_reply"
|
||||||
|
android:layout_margin="5dp"
|
||||||
|
app:layout_constraintTop_toTopOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintBottom_toTopOf="@+id/write_container_reply"
|
||||||
|
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_reply"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintBottom_toTopOf="@+id/separator_bottom_reply"
|
||||||
|
android:id="@+id/write_container_reply"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content">
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/my_pp_reply"
|
||||||
|
app:layout_constraintTop_toTopOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
android:layout_width="30dp"
|
||||||
|
android:layout_height="30dp"
|
||||||
|
android:contentDescription="@string/profile_picture" />
|
||||||
|
<studio.carbonylgroup.textfieldboxes.TextFieldBoxes
|
||||||
|
android:id="@+id/text_field_boxes_reply"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
app:layout_constraintTop_toTopOf="parent"
|
||||||
|
app:layout_constraintStart_toEndOf="@+id/my_pp_reply"
|
||||||
|
app:layout_constraintEnd_toStartOf="@+id/send_reply"
|
||||||
|
app:labelText="@string/add_public_reply"
|
||||||
|
app:secondaryColor="?attr/colorAccent"
|
||||||
|
app:primaryColor="?attr/colorAccent"
|
||||||
|
>
|
||||||
|
<studio.carbonylgroup.textfieldboxes.ExtendedEditText
|
||||||
|
android:id="@+id/add_comment_write_reply"
|
||||||
|
app:alwaysShowHint="false"
|
||||||
|
app:useDenseSpacing="false"
|
||||||
|
android:textSize="14sp"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
/>
|
||||||
|
</studio.carbonylgroup.textfieldboxes.TextFieldBoxes>
|
||||||
|
<ImageView
|
||||||
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
android:id="@+id/send_reply"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:contentDescription="@string/send_comment"
|
||||||
|
android:src="@drawable/ic_baseline_send_24"
|
||||||
|
/>
|
||||||
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
|
|
||||||
|
<View
|
||||||
|
android:id="@+id/separator_bottom_reply"
|
||||||
|
android:layout_margin="5dp"
|
||||||
|
app:layout_constraintTop_toBottomOf="@+id/write_container_reply"
|
||||||
|
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"/>
|
||||||
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
|
<androidx.recyclerview.widget.RecyclerView
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
android:id="@+id/peertube_reply"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content" />
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
</androidx.core.widget.NestedScrollView>
|
||||||
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
|
|
||||||
<!-- View where the video will be shown when video goes fullscreen -->
|
<!-- View where the video will be shown when video goes fullscreen -->
|
||||||
<RelativeLayout
|
<RelativeLayout
|
||||||
android:id="@+id/videoLayout"
|
android:id="@+id/videoLayout"
|
||||||
|
@ -83,34 +83,10 @@
|
|||||||
android:textAppearance="@style/TextAppearance.AppCompat.Body1"
|
android:textAppearance="@style/TextAppearance.AppCompat.Body1"
|
||||||
android:textColor="@android:color/white"
|
android:textColor="@android:color/white"
|
||||||
android:visibility="invisible"
|
android:visibility="invisible"
|
||||||
app:layout_constraintBottom_toBottomOf="@id/account_follow"
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
app:layout_constraintStart_toEndOf="@+id/account_pp"
|
app:layout_constraintStart_toEndOf="@+id/account_pp"
|
||||||
app:layout_constraintTop_toBottomOf="@id/account_dn" />
|
app:layout_constraintTop_toBottomOf="@id/account_dn" />
|
||||||
|
|
||||||
<Button
|
|
||||||
android:id="@+id/account_follow"
|
|
||||||
style="@style/Widget.AppCompat.Button.Colored"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_marginStart="10dp"
|
|
||||||
android:contentDescription="@string/make_an_action"
|
|
||||||
android:scaleType="fitCenter"
|
|
||||||
android:visibility="gone"
|
|
||||||
app:layout_constraintStart_toEndOf="@id/subscriber_count"
|
|
||||||
app:layout_constraintTop_toBottomOf="@id/account_dn" />
|
|
||||||
|
|
||||||
<Button
|
|
||||||
style="@style/Widget.AppCompat.Button.Colored"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_marginStart="10dp"
|
|
||||||
android:contentDescription="@string/edit_profile"
|
|
||||||
android:scaleType="fitCenter"
|
|
||||||
android:src="@drawable/ic_baseline_edit_24"
|
|
||||||
android:visibility="gone"
|
|
||||||
app:layout_constraintStart_toEndOf="@id/subscriber_count"
|
|
||||||
app:layout_constraintTop_toBottomOf="@id/account_dn" />
|
|
||||||
|
|
||||||
|
|
||||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
|
|
||||||
@ -135,11 +111,8 @@
|
|||||||
android:visibility="gone" />
|
android:visibility="gone" />
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
</RelativeLayout>
|
</RelativeLayout>
|
||||||
|
|
||||||
|
|
||||||
</com.google.android.material.appbar.CollapsingToolbarLayout>
|
</com.google.android.material.appbar.CollapsingToolbarLayout>
|
||||||
|
|
||||||
|
|
||||||
<com.google.android.material.tabs.TabLayout
|
<com.google.android.material.tabs.TabLayout
|
||||||
android:id="@+id/account_tabLayout"
|
android:id="@+id/account_tabLayout"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
@ -157,14 +130,4 @@
|
|||||||
android:layout_marginTop="5dp"
|
android:layout_marginTop="5dp"
|
||||||
app:layout_behavior="@string/appbar_scrolling_view_behavior" />
|
app:layout_behavior="@string/appbar_scrolling_view_behavior" />
|
||||||
|
|
||||||
<com.google.android.material.floatingactionbutton.FloatingActionButton
|
|
||||||
android:id="@+id/action_button"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_gravity="bottom|end"
|
|
||||||
android:layout_margin="@dimen/fab_margin_button"
|
|
||||||
android:src="@drawable/ic_baseline_add_24"
|
|
||||||
android:tint="@android:color/white"
|
|
||||||
android:visibility="gone" />
|
|
||||||
|
|
||||||
</androidx.coordinatorlayout.widget.CoordinatorLayout>
|
</androidx.coordinatorlayout.widget.CoordinatorLayout>
|
170
app/src/main/res/layout/activity_show_channel.xml
Normal file
170
app/src/main/res/layout/activity_show_channel.xml
Normal file
@ -0,0 +1,170 @@
|
|||||||
|
<?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.coordinatorlayout.widget.CoordinatorLayout 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:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:fitsSystemWindows="true"
|
||||||
|
tools:context=".ShowChannelActivity">
|
||||||
|
|
||||||
|
<com.google.android.material.appbar.AppBarLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:fitsSystemWindows="true"
|
||||||
|
app:theme="@style/ThemeOverlay.AppCompat.ActionBar">
|
||||||
|
|
||||||
|
<com.google.android.material.appbar.CollapsingToolbarLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:fitsSystemWindows="true"
|
||||||
|
app:contentScrim="?attr/colorPrimary"
|
||||||
|
app:expandedTitleMarginEnd="64dp"
|
||||||
|
app:expandedTitleMarginStart="48dp"
|
||||||
|
app:layout_scrollFlags="scroll|exitUntilCollapsed">
|
||||||
|
|
||||||
|
<RelativeLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content">
|
||||||
|
|
||||||
|
<androidx.constraintlayout.widget.ConstraintLayout
|
||||||
|
android:id="@+id/top_banner"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="5dp">
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/account_pp"
|
||||||
|
android:layout_width="80dp"
|
||||||
|
android:layout_height="80dp"
|
||||||
|
android:layout_margin="10dp"
|
||||||
|
android:layout_marginTop="10dp"
|
||||||
|
android:background="@drawable/account_pp_border"
|
||||||
|
android:contentDescription="@string/profile_picture"
|
||||||
|
android:padding="2dp"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toTopOf="parent" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/account_dn"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginStart="10dp"
|
||||||
|
android:singleLine="true"
|
||||||
|
android:textAppearance="@style/TextAppearance.AppCompat.Body1"
|
||||||
|
android:textColor="@android:color/white"
|
||||||
|
android:textSize="18sp"
|
||||||
|
app:layout_constraintBottom_toTopOf="@+id/subscriber_count"
|
||||||
|
app:layout_constraintStart_toEndOf="@+id/account_pp"
|
||||||
|
app:layout_constraintTop_toTopOf="@+id/account_pp" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/subscriber_count"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginStart="10dp"
|
||||||
|
android:layout_marginTop="10dp"
|
||||||
|
android:gravity="center_vertical"
|
||||||
|
android:singleLine="true"
|
||||||
|
android:textAppearance="@style/TextAppearance.AppCompat.Body1"
|
||||||
|
android:textColor="@android:color/white"
|
||||||
|
android:visibility="invisible"
|
||||||
|
app:layout_constraintBottom_toBottomOf="@id/account_follow"
|
||||||
|
app:layout_constraintStart_toEndOf="@+id/account_pp"
|
||||||
|
app:layout_constraintTop_toBottomOf="@id/account_dn" />
|
||||||
|
|
||||||
|
<Button
|
||||||
|
android:id="@+id/account_follow"
|
||||||
|
style="@style/Widget.AppCompat.Button.Colored"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginStart="10dp"
|
||||||
|
android:contentDescription="@string/make_an_action"
|
||||||
|
android:scaleType="fitCenter"
|
||||||
|
android:visibility="gone"
|
||||||
|
app:layout_constraintStart_toEndOf="@id/subscriber_count"
|
||||||
|
app:layout_constraintTop_toBottomOf="@id/account_dn" />
|
||||||
|
|
||||||
|
<Button
|
||||||
|
style="@style/Widget.AppCompat.Button.Colored"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginStart="10dp"
|
||||||
|
android:contentDescription="@string/edit_profile"
|
||||||
|
android:scaleType="fitCenter"
|
||||||
|
android:src="@drawable/ic_baseline_edit_24"
|
||||||
|
android:visibility="gone"
|
||||||
|
app:layout_constraintStart_toEndOf="@id/subscriber_count"
|
||||||
|
app:layout_constraintTop_toBottomOf="@id/account_dn" />
|
||||||
|
|
||||||
|
|
||||||
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_below="@+id/top_banner"
|
||||||
|
android:gravity="center"
|
||||||
|
android:orientation="vertical"
|
||||||
|
android:paddingTop="8dp"
|
||||||
|
app:layout_scrollFlags="scroll|enterAlways">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/account_note"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="5dp"
|
||||||
|
android:gravity="center"
|
||||||
|
android:padding="10dp"
|
||||||
|
android:textColor="@android:color/white"
|
||||||
|
android:textIsSelectable="true"
|
||||||
|
android:visibility="gone" />
|
||||||
|
</LinearLayout>
|
||||||
|
</RelativeLayout>
|
||||||
|
|
||||||
|
|
||||||
|
</com.google.android.material.appbar.CollapsingToolbarLayout>
|
||||||
|
|
||||||
|
|
||||||
|
<com.google.android.material.tabs.TabLayout
|
||||||
|
android:id="@+id/account_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>
|
||||||
|
|
||||||
|
<androidx.viewpager.widget.ViewPager
|
||||||
|
android:id="@+id/account_viewpager"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="5dp"
|
||||||
|
app:layout_behavior="@string/appbar_scrolling_view_behavior" />
|
||||||
|
|
||||||
|
<com.google.android.material.floatingactionbutton.FloatingActionButton
|
||||||
|
android:id="@+id/action_button"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_gravity="bottom|end"
|
||||||
|
android:layout_margin="@dimen/fab_margin_button"
|
||||||
|
android:src="@drawable/ic_baseline_add_24"
|
||||||
|
android:tint="@android:color/white"
|
||||||
|
android:visibility="gone" />
|
||||||
|
|
||||||
|
</androidx.coordinatorlayout.widget.CoordinatorLayout>
|
@ -21,7 +21,9 @@
|
|||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:divider="?android:dividerHorizontal"
|
android:divider="?android:dividerHorizontal"
|
||||||
android:orientation="vertical"
|
android:orientation="vertical"
|
||||||
android:showDividers="end">
|
android:clickable="true"
|
||||||
|
android:showDividers="end"
|
||||||
|
android:focusable="true">
|
||||||
|
|
||||||
<androidx.constraintlayout.widget.ConstraintLayout
|
<androidx.constraintlayout.widget.ConstraintLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
@ -47,6 +49,18 @@
|
|||||||
app:layout_constraintStart_toEndOf="@+id/comment_account_profile"
|
app:layout_constraintStart_toEndOf="@+id/comment_account_profile"
|
||||||
app:layout_constraintTop_toTopOf="parent" />
|
app:layout_constraintTop_toTopOf="parent" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
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:ellipsize="end"
|
||||||
|
android:singleLine="true"
|
||||||
|
android:textSize="12sp"
|
||||||
|
app:layout_constraintStart_toEndOf="@+id/comment_account_profile"
|
||||||
|
app:layout_constraintTop_toBottomOf="@+id/comment_account_displayname" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/comment_date"
|
android:id="@+id/comment_date"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
@ -71,28 +85,103 @@
|
|||||||
app:layout_constraintEnd_toEndOf="parent"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
app:layout_constraintTop_toBottomOf="@+id/comment_date" />
|
app:layout_constraintTop_toBottomOf="@+id/comment_date" />
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:id="@+id/comment_account_username"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_marginTop="10dp"
|
|
||||||
android:ellipsize="end"
|
|
||||||
android:singleLine="true"
|
|
||||||
android:textSize="12sp"
|
|
||||||
app:layout_constraintBottom_toBottomOf="@+id/comment_account_profile"
|
|
||||||
app:layout_constraintStart_toEndOf="@+id/comment_account_profile"
|
|
||||||
app:layout_constraintTop_toBottomOf="@+id/comment_account_displayname" />
|
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/comment_content"
|
android:id="@+id/comment_content"
|
||||||
android:layout_width="0dp"
|
android:layout_width="0dp"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginTop="10dp"
|
android:layout_marginTop="5dp"
|
||||||
android:textIsSelectable="true"
|
android:textIsSelectable="true"
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
app:layout_constraintTop_toBottomOf="@+id/comment_account_profile" />
|
app:layout_constraintTop_toBottomOf="@+id/comment_account_profile" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/number_of_replies"
|
||||||
|
app:layout_constraintTop_toBottomOf="@+id/comment_content"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:textColor="?attr/colorAccent"/>
|
||||||
|
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
app:layout_constraintTop_toBottomOf="@+id/comment_content"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
android:layout_marginTop="5dp"
|
||||||
|
android:layout_marginBottom="5dp"
|
||||||
|
android:id="@+id/replyButton"
|
||||||
|
android:text="@string/reply"
|
||||||
|
android:textColor="?attr/colorAccent"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"/>
|
||||||
|
|
||||||
|
<androidx.constraintlayout.widget.ConstraintLayout
|
||||||
|
app:layout_constraintTop_toBottomOf="@+id/replyButton"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
android:id="@+id/write_comment_container_reply"
|
||||||
|
android:layout_margin="10dp"
|
||||||
|
android:visibility="gone"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content">
|
||||||
|
<View
|
||||||
|
android:id="@+id/separator_top_reply"
|
||||||
|
android:layout_margin="5dp"
|
||||||
|
app:layout_constraintTop_toTopOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintBottom_toTopOf="@+id/write_container_reply"
|
||||||
|
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_reply"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintBottom_toTopOf="@+id/separator_bottom_reply"
|
||||||
|
android:id="@+id/write_container_reply"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content">
|
||||||
|
<studio.carbonylgroup.textfieldboxes.TextFieldBoxes
|
||||||
|
android:id="@+id/text_field_boxes_reply"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
app:layout_constraintTop_toTopOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintEnd_toStartOf="@+id/send_reply"
|
||||||
|
app:labelText="@string/add_public_reply"
|
||||||
|
app:secondaryColor="?attr/colorAccent"
|
||||||
|
app:primaryColor="?attr/colorAccent"
|
||||||
|
>
|
||||||
|
<studio.carbonylgroup.textfieldboxes.ExtendedEditText
|
||||||
|
android:id="@+id/add_comment_write_reply"
|
||||||
|
app:alwaysShowHint="false"
|
||||||
|
app:useDenseSpacing="false"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
/>
|
||||||
|
</studio.carbonylgroup.textfieldboxes.TextFieldBoxes>
|
||||||
|
<ImageView
|
||||||
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
android:id="@+id/send_reply"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:contentDescription="@string/send_comment"
|
||||||
|
android:src="@drawable/ic_baseline_send_24"
|
||||||
|
/>
|
||||||
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
|
|
||||||
|
<View
|
||||||
|
android:id="@+id/separator_bottom_reply"
|
||||||
|
android:layout_margin="5dp"
|
||||||
|
app:layout_constraintTop_toBottomOf="@+id/write_container_reply"
|
||||||
|
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"/>
|
||||||
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
@ -3,9 +3,10 @@ buildscript {
|
|||||||
repositories {
|
repositories {
|
||||||
google()
|
google()
|
||||||
jcenter()
|
jcenter()
|
||||||
|
mavenCentral()
|
||||||
}
|
}
|
||||||
dependencies {
|
dependencies {
|
||||||
classpath 'com.android.tools.build:gradle:4.0.2'
|
classpath 'com.android.tools.build:gradle:4.1.0'
|
||||||
def nav_version = "2.3.0"
|
def nav_version = "2.3.0"
|
||||||
classpath "androidx.navigation:navigation-safe-args-gradle-plugin:$nav_version"
|
classpath "androidx.navigation:navigation-safe-args-gradle-plugin:$nav_version"
|
||||||
// NOTE: Do not place your application dependencies here; they belong
|
// NOTE: Do not place your application dependencies here; they belong
|
||||||
@ -17,6 +18,8 @@ allprojects {
|
|||||||
repositories {
|
repositories {
|
||||||
google()
|
google()
|
||||||
jcenter()
|
jcenter()
|
||||||
|
mavenCentral()
|
||||||
|
mavenLocal()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
4
gradle/wrapper/gradle-wrapper.properties
vendored
4
gradle/wrapper/gradle-wrapper.properties
vendored
@ -1,6 +1,6 @@
|
|||||||
#Thu Jun 25 14:34:43 CEST 2020
|
#Wed Oct 14 09:54:01 CEST 2020
|
||||||
distributionBase=GRADLE_USER_HOME
|
distributionBase=GRADLE_USER_HOME
|
||||||
distributionPath=wrapper/dists
|
distributionPath=wrapper/dists
|
||||||
zipStoreBase=GRADLE_USER_HOME
|
zipStoreBase=GRADLE_USER_HOME
|
||||||
zipStorePath=wrapper/dists
|
zipStorePath=wrapper/dists
|
||||||
distributionUrl=https\://services.gradle.org/distributions/gradle-6.1.1-all.zip
|
distributionUrl=https\://services.gradle.org/distributions/gradle-6.5-all.zip
|
||||||
|
Reference in New Issue
Block a user