new release

This commit is contained in:
Page Asgardius 2022-10-11 08:37:26 -07:00
parent 7d20847840
commit db5f75b0b2
4 changed files with 5 additions and 125 deletions

View file

@ -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"

View file

@ -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);
}
}
}

View file

@ -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;
}
}
}

View file

@ -0,0 +1 @@
Fix Picture in Picture