new release
This commit is contained in:
parent
29f5aa5b60
commit
03b5f4f19a
5 changed files with 36 additions and 6 deletions
|
@ -9,8 +9,8 @@ android {
|
|||
applicationId "asgardius.page.s3music"
|
||||
minSdk 21
|
||||
targetSdk 33
|
||||
versionCode 9
|
||||
versionName "0.1.1"
|
||||
versionCode 10
|
||||
versionName "0.2.0"
|
||||
setProperty("archivesBaseName", "s3-music-$versionName")
|
||||
|
||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||
|
|
|
@ -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" />
|
||||
|
|
21
app/src/main/java/asgardius/page/s3music/SdcardCheck.java
Normal file
21
app/src/main/java/asgardius/page/s3music/SdcardCheck.java
Normal file
|
@ -0,0 +1,21 @@
|
|||
package asgardius.page.s3music;
|
||||
|
||||
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;
|
||||
}
|
||||
}
|
|
@ -185,10 +185,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);
|
||||
controlView.setPlayer(player);
|
||||
playerView.setUseController(false);
|
||||
|
|
1
fastlane/metadata/android/en-US/changelogs/10.txt
Normal file
1
fastlane/metadata/android/en-US/changelogs/10.txt
Normal file
|
@ -0,0 +1 @@
|
|||
* Allow move app to SD Card
|
Loading…
Reference in a new issue