From db5f75b0b2b1c0e0a32244b753a2107fc7f00cc1 Mon Sep 17 00:00:00 2001 From: Page Asgardius Date: Tue, 11 Oct 2022 08:37:26 -0700 Subject: [PATCH] new release --- app/build.gradle | 4 +- .../asgardius/page/s3manager/VideoPlayer.java | 86 +------------------ .../page/s3manager/VideoPlayerPip.java | 39 --------- .../metadata/android/en-US/changelogs/36.txt | 1 + 4 files changed, 5 insertions(+), 125 deletions(-) create mode 100644 fastlane/metadata/android/en-US/changelogs/36.txt diff --git a/app/build.gradle b/app/build.gradle index 217a307..cecf92e 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -9,8 +9,8 @@ android { applicationId "asgardius.page.s3manager" minSdk 23 targetSdk 33 - versionCode 35 - versionName "0.2.0" + versionCode 36 + versionName "0.2.1" setProperty("archivesBaseName", "s3-manager-$versionName") testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" diff --git a/app/src/main/java/asgardius/page/s3manager/VideoPlayer.java b/app/src/main/java/asgardius/page/s3manager/VideoPlayer.java index 119a6a3..31f73c9 100644 --- a/app/src/main/java/asgardius/page/s3manager/VideoPlayer.java +++ b/app/src/main/java/asgardius/page/s3manager/VideoPlayer.java @@ -234,31 +234,6 @@ public class VideoPlayer extends AppCompatActivity { | View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN); } - - protected void enterPIPMode() { - try { - if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.N - && this.getPackageManager() - .hasSystemFeature( - PackageManager.FEATURE_PICTURE_IN_PICTURE) && appOpsManager.checkOpNoThrow( - AppOpsManager.OPSTR_PICTURE_IN_PICTURE, - this.getPackageManager().getApplicationInfo(this.getPackageName(), - PackageManager.GET_META_DATA).uid, this.getPackageName()) - == AppOpsManager.MODE_ALLOWED) { - videoPosition = player.getCurrentPosition(); - playerView.setUseController(false); - if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { - PictureInPictureParams params = new PictureInPictureParams.Builder().build(); - this.enterPictureInPictureMode(params); - }else { - this.enterPictureInPictureMode(); - } - } - } catch (PackageManager.NameNotFoundException e) { - e.printStackTrace(); - } - } - @Override public void onDestroy() { @@ -281,65 +256,8 @@ public class VideoPlayer extends AppCompatActivity { public void onUserLeaveHint() { super.onUserLeaveHint(); - enterPIPMode(); - } - - public void onBackPressed() { - try { - if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.N - && this.getPackageManager() - .hasSystemFeature( - PackageManager.FEATURE_PICTURE_IN_PICTURE) && appOpsManager.checkOpNoThrow( - AppOpsManager.OPSTR_PICTURE_IN_PICTURE, - this.getPackageManager().getApplicationInfo(this.getPackageName(), - PackageManager.GET_META_DATA).uid, this.getPackageName()) - == AppOpsManager.MODE_ALLOWED) { - enterPIPMode(); - } else { - super.onBackPressed(); - } - } catch (PackageManager.NameNotFoundException e) { - e.printStackTrace(); - super.onBackPressed(); - } - } - - private class DescriptionAdapter implements - PlayerNotificationManager.MediaDescriptionAdapter { - - @Override - public String getCurrentContentTitle(Player player) { - int window = player.getCurrentMediaItemIndex(); - return getTitle().toString(); - } - - @Nullable - @Override - public String getCurrentContentText(Player player) { - int window = player.getCurrentMediaItemIndex(); - return getCurrentContentText(player); - } - - @Nullable - @Override - public Bitmap getCurrentLargeIcon(Player player, - PlayerNotificationManager.BitmapCallback callback) { - int window = player.getCurrentMediaItemIndex(); - Bitmap largeIcon = getCurrentLargeIcon(player, callback); - /*if (largeIcon == null && getLargeIconUri(window) != null) { - // load bitmap async - loadBitmap(getLargeIconUri(window), callback); - return getPlaceholderBitmap(); - }*/ - return largeIcon; - } - - @Nullable - @Override - public PendingIntent createCurrentContentIntent(Player player) { - int window = player.getCurrentMediaItemIndex(); - //return createPendingIntent(window); - return null; + if (playerView.getUseController()) { + playerView.setUseController(false); } } } \ No newline at end of file diff --git a/app/src/main/java/asgardius/page/s3manager/VideoPlayerPip.java b/app/src/main/java/asgardius/page/s3manager/VideoPlayerPip.java index 44b3c9c..b5c56f1 100644 --- a/app/src/main/java/asgardius/page/s3manager/VideoPlayerPip.java +++ b/app/src/main/java/asgardius/page/s3manager/VideoPlayerPip.java @@ -303,43 +303,4 @@ public class VideoPlayerPip extends AppCompatActivity { super.onBackPressed(); } } - - private class DescriptionAdapter implements - PlayerNotificationManager.MediaDescriptionAdapter { - - @Override - public String getCurrentContentTitle(Player player) { - int window = player.getCurrentMediaItemIndex(); - return getTitle().toString(); - } - - @Nullable - @Override - public String getCurrentContentText(Player player) { - int window = player.getCurrentMediaItemIndex(); - return getCurrentContentText(player); - } - - @Nullable - @Override - public Bitmap getCurrentLargeIcon(Player player, - PlayerNotificationManager.BitmapCallback callback) { - int window = player.getCurrentMediaItemIndex(); - Bitmap largeIcon = getCurrentLargeIcon(player, callback); - /*if (largeIcon == null && getLargeIconUri(window) != null) { - // load bitmap async - loadBitmap(getLargeIconUri(window), callback); - return getPlaceholderBitmap(); - }*/ - return largeIcon; - } - - @Nullable - @Override - public PendingIntent createCurrentContentIntent(Player player) { - int window = player.getCurrentMediaItemIndex(); - //return createPendingIntent(window); - return null; - } - } } \ No newline at end of file diff --git a/fastlane/metadata/android/en-US/changelogs/36.txt b/fastlane/metadata/android/en-US/changelogs/36.txt new file mode 100644 index 0000000..a82e1ef --- /dev/null +++ b/fastlane/metadata/android/en-US/changelogs/36.txt @@ -0,0 +1 @@ +Fix Picture in Picture \ No newline at end of file