new release

This commit is contained in:
Page Asgardius 2023-07-27 15:32:26 -07:00
parent 532b05dde2
commit f84b96cfc6
6 changed files with 36 additions and 7 deletions

View File

@ -1,4 +1,3 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="DesignSurface">
<option name="filePathToZoomLevelMap">

View File

@ -9,8 +9,8 @@ android {
applicationId "asgardius.page.s3manager"
minSdk 21
targetSdk 33
versionCode 83
versionName "0.9.6"
versionCode 84
versionName "0.10.0"
setProperty("archivesBaseName", "s3-manager-$versionName")
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"

View File

@ -1,5 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
android:installLocation="auto"
xmlns:tools="http://schemas.android.com/tools">
<uses-permission android:name="android.permission.INTERNET" />

View File

@ -0,0 +1,21 @@
package asgardius.page.s3manager;
import android.content.Context;
import android.content.pm.ApplicationInfo;
import android.content.pm.PackageInfo;
import android.content.pm.PackageManager;
public class SdcardCheck {
public static boolean isInstalledOnSdCard(Context context) {
PackageManager pm = context.getPackageManager();
try {
PackageInfo pi = pm.getPackageInfo(context.getPackageName(), 0);
ApplicationInfo ai = pi.applicationInfo;
return (ai.flags & ApplicationInfo.FLAG_EXTERNAL_STORAGE) == ApplicationInfo.FLAG_EXTERNAL_STORAGE;
} catch (PackageManager.NameNotFoundException e) {
// ignore
}
return false;
}
}

View File

@ -127,10 +127,17 @@ public class VideoPlayer extends AppCompatActivity {
mediaSessionConnector.setPlayer(player);
mediaSession.setActive(true);
evictor = new LeastRecentlyUsedCacheEvictor(maxCacheSize);
simpleCache = new SimpleCache(
new File(this.getFilesDir(), "media"),
evictor,
standaloneDatabaseProvider);
if(SdcardCheck.isInstalledOnSdCard(this)) {
simpleCache = new SimpleCache(
new File(this.getExternalFilesDirs(null)[this.getExternalFilesDirs(null).length-1], "media"),
evictor,
standaloneDatabaseProvider);
} else {
simpleCache = new SimpleCache(
new File(this.getFilesDir(), "media"),
evictor,
standaloneDatabaseProvider);
}
playerView.setPlayer(player);
control = new StyledPlayerView.ControllerVisibilityListener() {
@Override

View File

@ -0,0 +1 @@
* Allow move app to SD Card