From 857ab65f93ea5d5fad8f9bed0fec95987ba3410b Mon Sep 17 00:00:00 2001 From: Thomas Date: Sat, 24 Oct 2020 16:36:49 +0200 Subject: [PATCH] Some improvements --- app/build.gradle | 4 ++-- .../play/release-notes/en-US/default.txt | 8 +++++--- .../play/release-notes/en-US/default.txt | 9 ++++++++- .../app/fedilab/fedilabtube/MainActivity.java | 8 ++++++++ .../fedilab/fedilabtube/PeertubeActivity.java | 15 ++++++++++++--- .../services/RetrieveInfoService.java | 18 ++++++++++-------- 6 files changed, 45 insertions(+), 17 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index abc5715..1e4c1ca 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -11,8 +11,8 @@ android { minSdkVersion 21 targetSdkVersion 30 - versionCode 20 - versionName "1.5.1" + versionCode 21 + versionName "1.5.2" multiDexEnabled true testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" } diff --git a/app/src/fdroid_acad/play/release-notes/en-US/default.txt b/app/src/fdroid_acad/play/release-notes/en-US/default.txt index 7c23d7c..ed45711 100644 --- a/app/src/fdroid_acad/play/release-notes/en-US/default.txt +++ b/app/src/fdroid_acad/play/release-notes/en-US/default.txt @@ -1,3 +1,5 @@ -- Theme: Clair, Sombre et automatique -- Supprimer tous les commentaires d'un compte sur vos vidéos -- Mettre en sourdine un compte depuis les commentaires. \ No newline at end of file +- Nouvelles options : + - Mode plein écran automatique + - Désactiver la lecture automatique des vidéos + +- Quelques corrections de bugs \ No newline at end of file diff --git a/app/src/fdroid_full/play/release-notes/en-US/default.txt b/app/src/fdroid_full/play/release-notes/en-US/default.txt index 7a41508..d727833 100644 --- a/app/src/fdroid_full/play/release-notes/en-US/default.txt +++ b/app/src/fdroid_full/play/release-notes/en-US/default.txt @@ -1 +1,8 @@ -- Fix some issues \ No newline at end of file +Added: +- Enable/disable auto playback +- Enter in fullscreen automatically (default disabled) +- Back press pauses the video in fullscreen + +Fixes: +- Public timelines don't honor muted accounts +- Comments are not removed when switching to a video without comments \ No newline at end of file diff --git a/app/src/main/java/app/fedilab/fedilabtube/MainActivity.java b/app/src/main/java/app/fedilab/fedilabtube/MainActivity.java index 07d4fb2..3d23deb 100644 --- a/app/src/main/java/app/fedilab/fedilabtube/MainActivity.java +++ b/app/src/main/java/app/fedilab/fedilabtube/MainActivity.java @@ -41,6 +41,7 @@ import com.kobakei.ratethisapp.RateThisApp; import org.jetbrains.annotations.NotNull; +import java.util.LinkedHashMap; import java.util.List; import java.util.Set; import java.util.TreeSet; @@ -246,6 +247,13 @@ public class MainActivity extends AppCompatActivity { } else { navView.inflateMenu(R.menu.bottom_nav_menu); } + peertubeInformation = new PeertubeInformation(); + peertubeInformation.setCategories(new LinkedHashMap<>()); + peertubeInformation.setLanguages(new LinkedHashMap<>()); + peertubeInformation.setLicences(new LinkedHashMap<>()); + peertubeInformation.setPrivacies(new LinkedHashMap<>()); + peertubeInformation.setPlaylistPrivacies(new LinkedHashMap<>()); + peertubeInformation.setTranslations(new LinkedHashMap<>()); startInForeground(); if (BuildConfig.google_restriction && BuildConfig.full_instances) { diff --git a/app/src/main/java/app/fedilab/fedilabtube/PeertubeActivity.java b/app/src/main/java/app/fedilab/fedilabtube/PeertubeActivity.java index 4124919..2fa2c8a 100644 --- a/app/src/main/java/app/fedilab/fedilabtube/PeertubeActivity.java +++ b/app/src/main/java/app/fedilab/fedilabtube/PeertubeActivity.java @@ -48,6 +48,7 @@ import android.view.inputmethod.InputMethodManager; import android.widget.ArrayAdapter; import android.widget.EditText; import android.widget.FrameLayout; +import android.widget.ImageButton; import android.widget.ImageView; import android.widget.LinearLayout; import android.widget.TextView; @@ -307,7 +308,7 @@ public class PeertubeActivity extends AppCompatActivity implements CommentListAd playVideo(); } registBroadcastReceiver(); - if( autoFullscreen) { + if( autoFullscreen && autoPlay) { openFullscreenDialog(); setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE); } @@ -407,7 +408,7 @@ public class PeertubeActivity extends AppCompatActivity implements CommentListAd player.setPlayWhenReady(autoPlay); captions = null; } - if( autoFullscreen) { + if( autoFullscreen && autoPlay) { fullscreen = FullScreenMediaController.fullscreen.ON; setFullscreen(FullScreenMediaController.fullscreen.ON); fullScreenMode = true; @@ -1194,6 +1195,14 @@ public class PeertubeActivity extends AppCompatActivity implements CommentListAd } }); + ImageButton playButton = controlView.findViewById(R.id.exo_play); + playButton.setOnClickListener(v->{ + if(autoFullscreen && !fullScreenMode) { + openFullscreenDialog(); + setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE); + } + player.setPlayWhenReady(true); + }); } private void initResolution() { @@ -1237,7 +1246,7 @@ public class PeertubeActivity extends AppCompatActivity implements CommentListAd } public void manageVIewPlaylists(APIResponse apiResponse) { - if (apiResponse.getError() != null) { + if (apiResponse == null || apiResponse.getError() != null || playlists == null || peertube == null) { return; } if (apiResponse.getPlaylists() != null && apiResponse.getPlaylists().size() > 0) { diff --git a/app/src/main/java/app/fedilab/fedilabtube/services/RetrieveInfoService.java b/app/src/main/java/app/fedilab/fedilabtube/services/RetrieveInfoService.java index 83828d7..00561c4 100644 --- a/app/src/main/java/app/fedilab/fedilabtube/services/RetrieveInfoService.java +++ b/app/src/main/java/app/fedilab/fedilabtube/services/RetrieveInfoService.java @@ -127,14 +127,16 @@ public class RetrieveInfoService extends Service implements NetworkStateReceiver @Override public void run() { EmojiHelper.fillMapEmoji(getApplicationContext()); - peertubeInformation = new PeertubeInformation(); - peertubeInformation.setCategories(new LinkedHashMap<>()); - peertubeInformation.setLanguages(new LinkedHashMap<>()); - peertubeInformation.setLicences(new LinkedHashMap<>()); - peertubeInformation.setPrivacies(new LinkedHashMap<>()); - peertubeInformation.setPlaylistPrivacies(new LinkedHashMap<>()); - peertubeInformation.setTranslations(new LinkedHashMap<>()); - peertubeInformation = new RetrofitPeertubeAPI(RetrieveInfoService.this).getPeertubeInformation(); + if( peertubeInformation == null || peertubeInformation.getCategories().size() == 0) { + peertubeInformation = new PeertubeInformation(); + peertubeInformation.setCategories(new LinkedHashMap<>()); + peertubeInformation.setLanguages(new LinkedHashMap<>()); + peertubeInformation.setLicences(new LinkedHashMap<>()); + peertubeInformation.setPrivacies(new LinkedHashMap<>()); + peertubeInformation.setPlaylistPrivacies(new LinkedHashMap<>()); + peertubeInformation.setTranslations(new LinkedHashMap<>()); + peertubeInformation = new RetrofitPeertubeAPI(RetrieveInfoService.this).getPeertubeInformation(); + } stopForeground(true); } };