player
This commit is contained in:
parent
d100a67bf7
commit
05ff5a7488
|
@ -8,10 +8,10 @@ android {
|
||||||
|
|
||||||
defaultConfig {
|
defaultConfig {
|
||||||
applicationId "com.xixun.xixunplayer"
|
applicationId "com.xixun.xixunplayer"
|
||||||
minSdk 24
|
minSdk 21
|
||||||
targetSdk 34
|
targetSdk 34
|
||||||
versionCode 1
|
versionCode 1
|
||||||
versionName "1.0.23-sche"
|
versionName "1.1"
|
||||||
|
|
||||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||||
}
|
}
|
||||||
|
|
|
@ -13,6 +13,7 @@
|
||||||
<application
|
<application
|
||||||
android:allowBackup="true"
|
android:allowBackup="true"
|
||||||
android:usesCleartextTraffic="true"
|
android:usesCleartextTraffic="true"
|
||||||
|
android:launchMode="singleTop"
|
||||||
android:dataExtractionRules="@xml/data_extraction_rules"
|
android:dataExtractionRules="@xml/data_extraction_rules"
|
||||||
android:fullBackupContent="@xml/backup_rules"
|
android:fullBackupContent="@xml/backup_rules"
|
||||||
android:icon="@mipmap/ic_launcher"
|
android:icon="@mipmap/ic_launcher"
|
||||||
|
|
|
@ -309,7 +309,7 @@ public class MainActivity extends ComponentActivity implements Choreographer.Fra
|
||||||
}
|
}
|
||||||
} catch (FileNotFoundException e) {
|
} catch (FileNotFoundException e) {
|
||||||
state = 3;
|
state = 3;
|
||||||
Util.printStackTrace(e);
|
Util.println(""+e);
|
||||||
} catch (Throwable e) {
|
} catch (Throwable e) {
|
||||||
state = 7;
|
state = 7;
|
||||||
Util.makeText(this, Util.toStr(e)).show();
|
Util.makeText(this, Util.toStr(e)).show();
|
||||||
|
@ -319,12 +319,16 @@ public class MainActivity extends ComponentActivity implements Choreographer.Fra
|
||||||
public void initProg(byte[] json) {
|
public void initProg(byte[] json) {
|
||||||
try {
|
try {
|
||||||
Util.println("\nParse Prog Json");
|
Util.println("\nParse Prog Json");
|
||||||
var task = JSMap.from(json).jsmap("task");
|
var root = JSMap.from(json);
|
||||||
|
var task = root.jsmap("task");
|
||||||
if(task==null) {
|
if(task==null) {
|
||||||
state = 7;
|
if(! root.containsKey("layers")) {
|
||||||
Util.println(" Error: task==null\n");
|
state = 7;
|
||||||
Util.println(new String(json, Chsets.UTF8));
|
Util.println(" Error: task==null\n");
|
||||||
return;
|
Util.println(new String(json, Chsets.UTF8));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
task = new JSMap("items", new JSList<>(new JSMap("repeatTimes", 1, "_program", root)));
|
||||||
}
|
}
|
||||||
var view = new Prog(task, this);
|
var view = new Prog(task, this);
|
||||||
if(view.getChildCount()==0) {
|
if(view.getChildCount()==0) {
|
||||||
|
|
|
@ -233,7 +233,13 @@ public class Server extends Service {
|
||||||
} else if(_type.equals("SetPlayerBackground")) {
|
} else if(_type.equals("SetPlayerBackground")) {
|
||||||
var url = json.str("url");
|
var url = json.str("url");
|
||||||
if(url==null) new File(Util.backImgFile).delete();
|
if(url==null) new File(Util.backImgFile).delete();
|
||||||
else IOs.writeClose(new FileOutputStream(Util.backImgFile), new URLConn(url).in());
|
else {
|
||||||
|
var fout = new FileOutputStream(Util.backImgFile);
|
||||||
|
IOs.write(fout, new URLConn(url).in());
|
||||||
|
fout.flush();
|
||||||
|
fout.getFD().sync();
|
||||||
|
fout.close();
|
||||||
|
}
|
||||||
MainActivity.ins.runOnUiThread(() -> {
|
MainActivity.ins.runOnUiThread(() -> {
|
||||||
MainActivity.ins.backView.cosImg = url==null ? null : BitmapFactory.decodeFile(Util.backImgFile);
|
MainActivity.ins.backView.cosImg = url==null ? null : BitmapFactory.decodeFile(Util.backImgFile);
|
||||||
MainActivity.ins.backView.invalidate();
|
MainActivity.ins.backView.invalidate();
|
||||||
|
|
Loading…
Reference in New Issue
Block a user