Compare commits

...

2 commits

Author SHA1 Message Date
0e1391e89d new release 2023-07-28 04:48:26 -07:00
f84b96cfc6 new release 2023-07-27 15:32:26 -07:00
7 changed files with 37 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 85
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

@ -115,6 +115,7 @@ public class Settings extends AppCompatActivity {
try {
standaloneDatabaseProvider = new StandaloneDatabaseProvider(getApplicationContext());
SimpleCache.delete(new File(getApplicationContext().getFilesDir(), "media"), standaloneDatabaseProvider);
SimpleCache.delete(new File(getApplicationContext().getExternalFilesDirs(null)[getApplicationContext().getExternalFilesDirs(null).length-1], "media"), standaloneDatabaseProvider);
standaloneDatabaseProvider.close();
Toast.makeText(getApplicationContext(),getResources().getString(R.string.clearcache_ok), Toast.LENGTH_SHORT).show();
} catch (Exception e) {

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