From 1ac99bcc2f3829e2336448cbc8990474bec8908c Mon Sep 17 00:00:00 2001 From: Don Kimberlin Date: Sat, 27 Jun 2020 12:45:46 -0700 Subject: [PATCH] Floating window support and cleaning up some background behavior (#182) * Trying to add PIP mode for floating playback * PIP mode for floating playback. * PIP mode for floating playback. * PIP mode for floating playback. * PIP mode for floating playback. * PIP mode for floating playback. * PIP mode for floating playback. * PIP mode for floating playback. * PIP mode for floating playback. * PIP mode for floating playback. * PIP mode for floating playback. * PIP mode for floating playback. * PIP mode for floating playback. * PIP mode for floating playback. * PIP mode for floating playback. * PIP mode for floating playback. * PIP mode for floating playback. * Trying to add PIP mode for floating playback * PIP mode for floating playback. * PIP mode for floating playback. * PIP mode for floating playback. * PIP mode for floating playback. * PIP mode for floating playback. * PIP mode for floating playback. * PIP mode for floating playback. * PIP mode for floating playback. * PIP mode for floating playback. * PIP mode for floating playback. * PIP mode for floating playback. * PIP mode for floating playback. * PIP mode for floating playback. * PIP mode for floating playback. * PIP mode for floating playback. * PIP mode for floating playback. * PIP mode for floating playback. * PIP mode for floating playback. * PIP mode for floating playback. * PIP mode for floating playback. --- app/src/main/AndroidManifest.xml | 3 +- .../peertube/activity/VideoPlayActivity.java | 160 +++++++++++++++++- .../fragment/VideoPlayerFragment.java | 126 ++++++++++++-- .../peertube/service/VideoPlayerService.java | 9 + app/src/main/res/values-bn-rBD/strings.xml | 75 +------- app/src/main/res/values/array.xml | 13 ++ app/src/main/res/values/strings.xml | 9 +- app/src/main/res/xml/pref_general.xml | 10 ++ 8 files changed, 307 insertions(+), 98 deletions(-) diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 11f705c..32125e5 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -34,7 +34,8 @@ android:name=".activity.VideoPlayActivity" android:configChanges="keyboard|keyboardHidden|orientation|screenSize|screenLayout|smallestScreenSize|uiMode" android:label="@string/title_activity_video_play" - android:launchMode="singleTop" + android:launchMode="singleInstance" + android:supportsPictureInPicture="true" android:theme="@style/AppTheme.NoActionBar" /> { Log.d(TAG, "Fullscreen"); - if (!isFullscreen) { - isFullscreen = true; - activity.setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE); - } else { - isFullscreen = false; - activity.setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT); - } + fullScreenToggle(); }); if (!mBound) { @@ -182,7 +184,7 @@ public class VideoPlayerFragment extends Fragment implements VideoRendererEventL mService.setCurrentVideo(video); if (video == null) { - Toast.makeText(context, "Something went wrong...Please try later!", Toast.LENGTH_SHORT).show(); + Toast.makeText(context, "Unable to retrieve video information, try again later.", Toast.LENGTH_SHORT).show(); return; } @@ -193,7 +195,7 @@ public class VideoPlayerFragment extends Fragment implements VideoRendererEventL @Override public void onFailure(@NonNull Call