Compare commits
17 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
1ee3c70bc3 | ||
|
|
4616264951 | ||
|
|
17bf9bac77 | ||
|
|
f2757e25c3 | ||
|
|
8c88ccccc9 | ||
|
|
18fdf78b61 | ||
|
|
6f19874810 | ||
|
|
50532cdf34 | ||
|
|
bec33d0b8d | ||
|
|
fa7b623a96 | ||
|
|
dbb262716e | ||
|
|
c61d680fe9 | ||
|
|
89175adca6 | ||
|
|
c1ae9225be | ||
|
|
d5e94caef1 | ||
|
|
c7141c911c | ||
|
|
b6713a792f |
3
.gitignore
vendored
3
.gitignore
vendored
@@ -1,2 +1,5 @@
|
||||
.vscode/settings.json
|
||||
.vscode/tasks.json
|
||||
rhino.jar
|
||||
update.sh
|
||||
updateSharedSheets.js
|
||||
@@ -1 +1 @@
|
||||
65fdecb9be4821eaa1ef42a71598c250e64a3de5
|
||||
46162649517a1318c176a3808b932ec96dcce96b
|
||||
BIN
resources/clock.png
Normal file
BIN
resources/clock.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 7.0 KiB |
BIN
resources/note.png
Normal file
BIN
resources/note.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 3.8 KiB |
BIN
resources/piano.png
Normal file
BIN
resources/piano.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 2.6 KiB |
BIN
resources/user.png
Normal file
BIN
resources/user.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 7.3 KiB |
File diff suppressed because it is too large
Load Diff
BIN
shared_sheets/菊次郎的夏天(夏卡重制版).txt
Normal file
BIN
shared_sheets/菊次郎的夏天(夏卡重制版).txt
Normal file
Binary file not shown.
@@ -64,7 +64,7 @@ threads.start(function() {
|
||||
|
||||
sheetmgr = {
|
||||
rootDir: android.os.Environment.getExternalStorageDirectory() + "/Android/data/com.Maple.SkyStudio/files/Sheet/",
|
||||
encoding: "utf-16le",
|
||||
encoding: "x-UTF-16LE-BOM",
|
||||
|
||||
cachedLocalSheetList: [],
|
||||
cachedOnlineSharedSheetInfoList: [],
|
||||
@@ -101,6 +101,7 @@ sheetmgr = {
|
||||
}
|
||||
return stringBuffer.toString();
|
||||
} (7)) + ".txt");
|
||||
|
||||
var parsed;
|
||||
files.write(sheet, parsed = (function() {
|
||||
var data = eval(body.string())[0];
|
||||
@@ -110,7 +111,6 @@ sheetmgr = {
|
||||
return "[" + JSON.stringify(data) + "]";
|
||||
}()), sheetmgr.encoding);
|
||||
parsed = eval(parsed)[0];
|
||||
//parsed.songNotes = sheetmgr.parseSongNote(parsed.songNotes);
|
||||
parsed.fileName = sheet;
|
||||
sheetmgr.cachedLocalSheetList.push(parsed);
|
||||
listener({status:3});
|
||||
@@ -345,6 +345,9 @@ config = {
|
||||
_global_storage: null,
|
||||
|
||||
values: {
|
||||
currentVersion: 18,
|
||||
gitVersion: "",
|
||||
|
||||
key_coordinates15: [],
|
||||
key_coordinates8: [],
|
||||
skipRunScriptTip: false,
|
||||
@@ -356,8 +359,7 @@ config = {
|
||||
skipChangeKeyCountTip: false,
|
||||
showFailedSheets: true,
|
||||
tipOnAndroidR: true,
|
||||
currentVersion: 15,
|
||||
gitVersion: "",
|
||||
theme: "dark",
|
||||
},
|
||||
|
||||
bitmaps: {},
|
||||
@@ -376,6 +378,7 @@ config = {
|
||||
this.values.skipChangeKeyCountTip = this._global_storage.get("skip_change_key_count_tip", this.values.skipChangeKeyCountTip);
|
||||
this.values.showFailedSheets = this._global_storage.get("show_failed_sheets", this.values.showFailedSheets);
|
||||
this.values.tipOnAndroidR = this._global_storage.get("tip_storage_on_android_r", this.values.tipOnAndroidR);
|
||||
this.values.theme = this._global_storage.get("theme", this.values.theme);
|
||||
|
||||
try {
|
||||
android.os.Build.VERSION_CODES.R
|
||||
@@ -414,7 +417,7 @@ config = {
|
||||
|
||||
fetchResources: function(listener) {
|
||||
var remoteHost = "https://cdn.jsdelivr.net/gh/StageGuard/SkyAutoPlayerScript@" + this.values.gitVersion + "/resources/";
|
||||
var resourceList = ["local.png", "online.png", "play.png", "pause.png", "refresh.png", "settings.png", "info.png", "download.png", "bin.png", "speedup.png", "search.png"/*, "filter.png"*/];
|
||||
var resourceList = ["local.png", "online.png", "play.png", "pause.png", "refresh.png", "settings.png", "info.png", "download.png", "bin.png", "speedup.png", "search.png", "note.png", "user.png", "piano.png", "clock.png"/*, "filter.png"*/];
|
||||
var localRootDir = android.os.Environment.getExternalStorageDirectory() + "/Documents/SkyAutoPlayer/bitmaps/";
|
||||
var downloadQueue = [];
|
||||
var tryCount = 1;
|
||||
@@ -504,6 +507,23 @@ config = {
|
||||
}
|
||||
},
|
||||
|
||||
updateBitmapTheme: function() {
|
||||
var filterBitmap = function(bitmap, replacedColor) {
|
||||
var rBitmap = android.graphics.Bitmap.createBitmap(bitmap.getWidth(), bitmap.getHeight(), android.graphics.Bitmap.Config.ARGB_8888);
|
||||
var canvas = new android.graphics.Canvas(rBitmap);
|
||||
var paint = new android.graphics.Paint();
|
||||
var rect = new android.graphics.Rect(0, 0, bitmap.getWidth(), bitmap.getHeight());
|
||||
paint.setAntiAlias(true);
|
||||
canvas.drawARGB(0, 0, 0, 0);
|
||||
paint.setColorFilter(new android.graphics.PorterDuffColorFilter(replacedColor, android.graphics.PorterDuff.Mode.SRC_IN));
|
||||
canvas.drawBitmap(bitmap, rect, rect, paint);
|
||||
return rBitmap;
|
||||
};
|
||||
for(var i in this.bitmaps) {
|
||||
this.bitmaps[i] = filterBitmap(this.bitmaps[i], this.values.theme == "dark" ? android.graphics.Color.WHITE : android.graphics.Color.BLACK);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -719,11 +739,17 @@ gui = {
|
||||
|
||||
config: {
|
||||
colors: {
|
||||
dark: {
|
||||
background: android.graphics.Color.parseColor("#212121"),
|
||||
text: android.graphics.Color.WHITE,
|
||||
dark_text: android.graphics.Color.BLACK,
|
||||
text: android.graphics.Color.parseColor("#FFFFFF"),
|
||||
sec_text: android.graphics.Color.parseColor("#7B7B7B"),
|
||||
},
|
||||
light: {
|
||||
background: android.graphics.Color.parseColor("#F0F0F0"),
|
||||
text: android.graphics.Color.parseColor("#000000"),
|
||||
sec_text: android.graphics.Color.parseColor("#7B7B7B"),
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
utils: {
|
||||
@@ -755,7 +781,7 @@ gui = {
|
||||
if (customshape == "roundrect") gradientDrawable.setCornerRadius(arguments[3]);
|
||||
gradientDrawable.setStroke(dp * 10, android.graphics.Color.TRANSPARENT);
|
||||
return new android.graphics.drawable.RippleDrawable(android.content.res.ColorStateList.valueOf(android.graphics.Color.argb(1, 0, 0, 0)), gradientDrawable, mask);
|
||||
},
|
||||
}
|
||||
},
|
||||
|
||||
dialogs: {
|
||||
@@ -807,11 +833,11 @@ gui = {
|
||||
var layout = o.layout = new android.widget.LinearLayout(ctx);
|
||||
layout.setOrientation(android.widget.LinearLayout.VERTICAL);
|
||||
layout.setPadding(dp * 10, isNoText ? dp * 5 : dp * 10, dp * 10, isNoText ? dp * 5 : 0);
|
||||
layout.setBackgroundColor(gui.config.colors.background);
|
||||
layout.setBackgroundColor(gui.config.colors[config.values.theme].background);
|
||||
if (!isNoText) {
|
||||
var text = o.text = new android.widget.TextView(ctx);
|
||||
text.setLayoutParams(new android.widget.FrameLayout.LayoutParams(-2, -2));
|
||||
text.setTextColor(gui.config.colors.text);
|
||||
text.setTextColor(gui.config.colors[config.values.theme].text);
|
||||
text.setPadding(dp * 10, dp * 10, dp * 10, dp * 10);
|
||||
layout.addView(text);
|
||||
}
|
||||
@@ -900,7 +926,7 @@ gui = {
|
||||
try {
|
||||
var scr, layout, title, text, skip, onClick, dialog;
|
||||
scr = new android.widget.ScrollView(ctx);
|
||||
scr.setBackgroundColor(gui.config.colors.background);
|
||||
scr.setBackgroundColor(gui.config.colors[config.values.theme].background);
|
||||
layout = new android.widget.LinearLayout(ctx);
|
||||
layout.setLayoutParams(new android.widget.FrameLayout.LayoutParams(-2, -2));
|
||||
layout.setOrientation(android.widget.LinearLayout.VERTICAL);
|
||||
@@ -910,7 +936,7 @@ gui = {
|
||||
title.setText(s.title);
|
||||
title.setLayoutParams(new android.widget.LinearLayout.LayoutParams(-2, -2));
|
||||
title.setPadding(0, 0, 0, 10 * dp);
|
||||
title.setTextColor(gui.config.colors.text);
|
||||
title.setTextColor(gui.config.colors[config.values.theme].text);
|
||||
title.setTextSize(16);
|
||||
layout.addView(title);
|
||||
}
|
||||
@@ -919,7 +945,7 @@ gui = {
|
||||
text.setText(s.text);
|
||||
text.setPadding(0, 0, 0, 10 * dp);
|
||||
text.setLayoutParams(new android.widget.LinearLayout.LayoutParams(-2, -2));
|
||||
text.setTextColor(gui.config.colors.sec_text);
|
||||
text.setTextColor(gui.config.colors[config.values.theme].sec_text);
|
||||
text.setTextSize(14);
|
||||
layout.addView(text);
|
||||
}
|
||||
@@ -929,7 +955,7 @@ gui = {
|
||||
skip.setLayoutParams(android.widget.LinearLayout.LayoutParams(-2, -2, 0));
|
||||
skip.getLayoutParams().setMargins(0, 0, 0, 10 * dp)
|
||||
skip.setText("不再提示");
|
||||
skip.setTextColor(gui.config.colors.sec_text)
|
||||
skip.setTextColor(gui.config.colors[config.values.theme].sec_text)
|
||||
layout.addView(skip);
|
||||
}
|
||||
onClick = function(i) {
|
||||
@@ -944,7 +970,7 @@ gui = {
|
||||
b.setText(String(e));
|
||||
b.setGravity(android.view.Gravity.CENTER);
|
||||
b.setPadding(10 * dp, 10 * dp, 10 * dp, 10 * dp);
|
||||
b.setTextColor(gui.config.colors.text);
|
||||
b.setTextColor(gui.config.colors[config.values.theme].text);
|
||||
b.setTextSize(14);
|
||||
b.measure(0, 0);
|
||||
b.setBackgroundDrawable(gui.utils.ripple_drawable(b.getMeasuredWidth(), b.getMeasuredHeight(), "rect"));
|
||||
@@ -986,7 +1012,7 @@ gui = {
|
||||
e._title.setFocusable(false);
|
||||
e._title.setLayoutParams(new android.widget.LinearLayout.LayoutParams(-1, -2));
|
||||
e._title.setTextSize(16);
|
||||
e._title.setTextColor(gui.config.colors.text);
|
||||
e._title.setTextColor(gui.config.colors[config.values.theme].text);
|
||||
e.view.addView(e._title);
|
||||
if (e.description) {
|
||||
e._description = new android.widget.TextView(ctx);
|
||||
@@ -994,7 +1020,7 @@ gui = {
|
||||
e._description.setPadding(0, 3 * dp, 0, 0);
|
||||
e._description.setLayoutParams(android.widget.LinearLayout.LayoutParams(-1, -2));
|
||||
e._description.setTextSize(14);
|
||||
e._description.setTextColor(gui.config.colors.sec_text);
|
||||
e._description.setTextColor(gui.config.colors[config.values.theme].sec_text);
|
||||
e.view.addView(e._description);
|
||||
}
|
||||
return e.view;
|
||||
@@ -1002,7 +1028,7 @@ gui = {
|
||||
}
|
||||
frame = new android.widget.FrameLayout(ctx);
|
||||
frame.setPadding(5 * dp, 5 * dp, 5 * dp, 5 * dp);
|
||||
frame.setBackgroundColor(gui.config.colors.background);
|
||||
frame.setBackgroundColor(gui.config.colors[config.values.theme].background);
|
||||
list = new android.widget.ListView(ctx);
|
||||
list.setLayoutParams(new android.widget.FrameLayout.LayoutParams(-1, -2));
|
||||
list.setDividerHeight(0);
|
||||
@@ -1010,10 +1036,13 @@ gui = {
|
||||
list.setOnItemClickListener(new android.widget.AdapterView.OnItemClickListener({
|
||||
onItemClick: function(parent, view, pos, id) {
|
||||
try {
|
||||
if (callback && !callback(pos, s[pos])) gui.utils.value_animation("Float", 1, 0, 75, new android.view.animation.DecelerateInterpolator(), function(anim) {
|
||||
if (callback) {
|
||||
callback(pos);
|
||||
gui.utils.value_animation("Float", 1, 0, 75, new android.view.animation.DecelerateInterpolator(), function(anim) {
|
||||
dialog.setAlpha(anim.getAnimatedValue());
|
||||
if(anim.getAnimatedValue() == 1) gui.winMgr.removeView(dialog);
|
||||
});
|
||||
}
|
||||
return true;
|
||||
} catch (e) {
|
||||
error(e + " → " + e.lineNumber);
|
||||
@@ -1030,6 +1059,25 @@ gui = {
|
||||
},
|
||||
|
||||
|
||||
vmaker: {},
|
||||
|
||||
addViewMaker: function(name, vmaker) {
|
||||
if(!this.vmaker[name]) {
|
||||
this.vmaker[name] = vmaker;
|
||||
} else {
|
||||
error("ViewMaker " + name + " already exists.");
|
||||
}
|
||||
},
|
||||
|
||||
getViewMaker: function(name) {
|
||||
if(this.vmaker[name]) {
|
||||
return this.vmaker[name];
|
||||
} else {
|
||||
error("ViewMaker " + name + " doesn't exist.");
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
main: {
|
||||
|
||||
//window
|
||||
@@ -1137,11 +1185,11 @@ gui = {
|
||||
gui.main._global_base.setGravity(android.view.Gravity.CENTER | android.view.Gravity.CENTER);
|
||||
gui.main._global_base.setOrientation(android.widget.LinearLayout.VERTICAL);
|
||||
gui.main._global_base.setLayoutParams(new android.widget.LinearLayout.LayoutParams(dp * gui.main.window_width, dp * gui.main.window_height));
|
||||
gui.main._global_base.setBackgroundColor(gui.config.colors.background);
|
||||
gui.main._global_base.setBackgroundColor(gui.config.colors[config.values.theme].background);
|
||||
|
||||
gui.main._global_statusbar = new android.widget.RelativeLayout(ctx);
|
||||
gui.main._global_statusbar.setLayoutParams(new android.widget.RelativeLayout.LayoutParams(-1, dp * gui.main.status_bar_height));
|
||||
gui.main._global_statusbar.setBackgroundColor(gui.config.colors.background);
|
||||
gui.main._global_statusbar.setBackgroundColor(gui.config.colors[config.values.theme].background);
|
||||
gui.main._global_statusbar.setElevation(10 * dp);
|
||||
|
||||
gui.main._global_title = new android.widget.TextView(ctx);
|
||||
@@ -1152,7 +1200,7 @@ gui = {
|
||||
if(content.title != null) gui.main._global_title.setText(content.title);
|
||||
gui.main._global_title.setTextSize(15);
|
||||
gui.main._global_title.setShadowLayer(dp * 5, 0, 0, android.graphics.Color.BLACK);
|
||||
gui.main._global_title.setTextColor(gui.config.colors.text);
|
||||
gui.main._global_title.setTextColor(gui.config.colors[config.values.theme].text);
|
||||
gui.main._global_title.setOnTouchListener(new android.view.View.OnTouchListener({
|
||||
onTouch: function onTouchFunction(view, event) {
|
||||
switch (event.getAction()) {
|
||||
@@ -1183,7 +1231,7 @@ gui = {
|
||||
gui.main._global_close.setBackgroundDrawable(gui.utils.ripple_drawable(gui.main._global_close.getMeasuredWidth(), gui.main._global_close.getMeasuredHeight(), "rect"));
|
||||
gui.main._global_close.setText("×");
|
||||
gui.main._global_close.setTextSize(22);
|
||||
gui.main._global_close.setTextColor(gui.config.colors.text);
|
||||
gui.main._global_close.setTextColor(gui.config.colors[config.values.theme].text);
|
||||
gui.main._global_close.setOnClickListener(new android.view.View.OnClickListener({
|
||||
onClick: function() {
|
||||
gui.main.__internal_dismiss();
|
||||
@@ -1197,7 +1245,7 @@ gui = {
|
||||
|
||||
gui.main._global_content_container = new android.widget.RelativeLayout(ctx);
|
||||
gui.main._global_content_container.setLayoutParams(new android.widget.LinearLayout.LayoutParams(-1, dp * (gui.main.window_height - gui.main.status_bar_height - gui.main.navigation_bar_height)));
|
||||
gui.main._global_content_container.setBackgroundColor(gui.config.colors.background);
|
||||
gui.main._global_content_container.setBackgroundColor(gui.config.colors[config.values.theme].background);
|
||||
|
||||
s._content_height = dp * (gui.main.window_height - gui.main.status_bar_height - gui.main.navigation_bar_height);
|
||||
gui.main._global_content_container.measure(0, 0);
|
||||
@@ -1221,7 +1269,7 @@ gui = {
|
||||
gui.main._global_navigation_bar.setGravity(android.view.Gravity.CENTER | android.view.Gravity.CENTER);
|
||||
gui.main._global_navigation_bar.setOrientation(android.widget.LinearLayout.HORIZONTAL);
|
||||
gui.main._global_navigation_bar.setLayoutParams(new android.widget.LinearLayout.LayoutParams(-1, dp * (gui.main.navigation_bar_height + gui.main.navigation_bar_updown_margin * 2)));
|
||||
gui.main._global_navigation_bar.setBackgroundColor(gui.config.colors.background);
|
||||
gui.main._global_navigation_bar.setBackgroundColor(gui.config.colors[config.values.theme].background);
|
||||
|
||||
gui.main.__internal_genNavigationList(s, content);
|
||||
|
||||
@@ -1319,13 +1367,12 @@ gui = {
|
||||
var view = new android.widget.ImageView(ctx);
|
||||
view.setId(++s.baseFuncIndex);
|
||||
view.setLayoutParams(new android.widget.RelativeLayout.LayoutParams(dp * gui.main.status_bar_height, dp * gui.main.status_bar_height));
|
||||
view.setPadding(dp * 1, dp * 1, dp * 1, dp * 1);
|
||||
view.getLayoutParams().addRule(android.widget.RelativeLayout.LEFT_OF, s.baseFuncIndex - 1);
|
||||
view.measure(0, 0);
|
||||
view.setBackgroundDrawable(gui.utils.ripple_drawable(view.getMeasuredWidth(), view.getMeasuredHeight(), "rect"));
|
||||
view.setPadding(dp * 5, dp * 5, dp * 5, dp * 5);
|
||||
view.setAlpha(0);
|
||||
view.setImageBitmap(content.func[i].icon);
|
||||
view.setImageBitmap(config.bitmaps[content.func[i].icon]);
|
||||
view.setOnClickListener(new android.view.View.OnClickListener({
|
||||
onClick: function(view) {content.func[view.getId() - (gui.main._global_close.getId() + 1)].onClick(s, content)}
|
||||
}));
|
||||
@@ -1370,12 +1417,12 @@ gui = {
|
||||
s["navigationBtnText" + i].setText(gui.main.views[i].navigation_title);
|
||||
s["navigationBtnText" + i].setTextSize(12);
|
||||
s["navigationBtnText" + i].setShadowLayer(dp, 0, 0, android.graphics.Color.BLACK);
|
||||
s["navigationBtnText" + i].setTextColor(s.index == gui.main.views[i].index ? gui.config.colors.text : gui.config.colors.sec_text);
|
||||
s["navigationBtnText" + i].setTextColor(s.index == gui.main.views[i].index ? gui.config.colors[config.values.theme].text : gui.config.colors[config.values.theme].sec_text);
|
||||
|
||||
s["navigationBtnImg" + i] = new android.widget.ImageView(ctx);
|
||||
s["navigationBtnImg" + i].setId(14);
|
||||
s["navigationBtnImg" + i].setScaleType(android.widget.ImageView.ScaleType.CENTER_CROP);
|
||||
if(gui.main.views[i].navigation_icon != null) s["navigationBtnImg" + i].setImageBitmap(gui.main.views[i].navigation_icon);
|
||||
if(gui.main.views[i].navigation_icon != null) s["navigationBtnImg" + i].setImageBitmap(config.bitmaps[gui.main.views[i].navigation_icon]);
|
||||
s.__navigationBtnImgHeight = (function() {
|
||||
s["navigationBtnText" + i].measure(0, 0);
|
||||
return dp * gui.main.navigation_bar_height - s["navigationBtnText" + i].getMeasuredHeight();
|
||||
@@ -1391,11 +1438,11 @@ gui = {
|
||||
if(gui.main._global_navigation_bar == null) return;
|
||||
if(!/^android/.test(String(gui.main._global_navigation_bar.findViewById(s.index)))) return;
|
||||
if(gui.main.current_navigation_selection == s.index) return;
|
||||
var colorAnim = android.animation.ObjectAnimator.ofInt(gui.main._global_navigation_bar.findViewById(s.index).findViewById(12), "textColor", gui.config.colors.sec_text, gui.config.colors.text);
|
||||
var colorAnim = android.animation.ObjectAnimator.ofInt(gui.main._global_navigation_bar.findViewById(s.index).findViewById(12), "textColor", gui.config.colors[config.values.theme].sec_text, gui.config.colors[config.values.theme].text);
|
||||
colorAnim.setDuration(300);
|
||||
colorAnim.setEvaluator(new android.animation.ArgbEvaluator());
|
||||
colorAnim.start();
|
||||
colorAnim = android.animation.ObjectAnimator.ofInt(gui.main._global_navigation_bar.findViewById(gui.main.current_navigation_selection).findViewById(12), "textColor", gui.config.colors.text, gui.config.colors.sec_text);
|
||||
colorAnim = android.animation.ObjectAnimator.ofInt(gui.main._global_navigation_bar.findViewById(gui.main.current_navigation_selection).findViewById(12), "textColor", gui.config.colors[config.values.theme].text, gui.config.colors[config.values.theme].sec_text);
|
||||
colorAnim.setDuration(300);
|
||||
colorAnim.setEvaluator(new android.animation.ArgbEvaluator());
|
||||
colorAnim.start();
|
||||
@@ -1598,8 +1645,8 @@ gui = {
|
||||
if(!gui.key_coordinate_navigation.isShowingText) {
|
||||
gui.key_coordinate_navigation._global_text = new android.widget.TextView(ctx);
|
||||
gui.key_coordinate_navigation._global_text.setLayoutParams(new android.widget.LinearLayout.LayoutParams(-2, -2));
|
||||
gui.key_coordinate_navigation._global_text.setTextColor(gui.config.colors.text);
|
||||
gui.key_coordinate_navigation._global_text.setBackgroundColor(gui.config.colors.background);
|
||||
gui.key_coordinate_navigation._global_text.setTextColor(gui.config.colors[config.values.theme].text);
|
||||
gui.key_coordinate_navigation._global_text.setBackgroundColor(gui.config.colors[config.values.theme].background);
|
||||
gui.key_coordinate_navigation._global_text.setTextSize(16);
|
||||
gui.key_coordinate_navigation._global_text.setPadding(dp * 5, dp * 5, dp * 5, dp * 5);
|
||||
gui.key_coordinate_navigation._global_text.getLayoutParams().setMargins(dp * 5, dp * 5, dp * 5, dp * 5);
|
||||
@@ -1658,12 +1705,12 @@ gui = {
|
||||
gui.player_panel._global_base.setLayoutParams(new android.widget.LinearLayout.LayoutParams(-2, -2));
|
||||
gui.player_panel._global_base.setPadding(dp * 5, dp * 5, dp * 5, dp * 5);
|
||||
gui.player_panel._global_base.getLayoutParams().setMargins(dp * 5, dp * 5, dp * 5, dp * 5);
|
||||
gui.player_panel._global_base.setBackgroundColor(gui.config.colors.background);
|
||||
gui.player_panel._global_base.setBackgroundColor(gui.config.colors[config.values.theme].background);
|
||||
|
||||
gui.player_panel._global_text = new android.widget.TextView(ctx);
|
||||
gui.player_panel._global_text.setId(12);
|
||||
gui.player_panel._global_text.setLayoutParams(new android.widget.RelativeLayout.LayoutParams(-2, -2));
|
||||
gui.player_panel._global_text.setTextColor(gui.config.colors.text);
|
||||
gui.player_panel._global_text.setTextColor(gui.config.colors[config.values.theme].text);
|
||||
gui.player_panel._global_text.setTextSize(14);
|
||||
gui.player_panel._global_text.setText("解析中...");
|
||||
gui.player_panel._global_text.setSingleLine(true);
|
||||
@@ -1700,7 +1747,7 @@ gui = {
|
||||
s.close.setBackgroundDrawable(gui.utils.ripple_drawable(s.close.getMeasuredWidth(), s.close.getMeasuredHeight(), "rect"));
|
||||
s.close.setText("×");
|
||||
s.close.setTextSize(15);
|
||||
s.close.setTextColor(gui.config.colors.text);
|
||||
s.close.setTextColor(gui.config.colors[config.values.theme].text);
|
||||
s.close.setOnClickListener(new android.view.View.OnClickListener({
|
||||
onClick: function() {
|
||||
if(gui.player_panel.isShowing) {
|
||||
@@ -1739,7 +1786,7 @@ gui = {
|
||||
gui.player_panel._global_status.getLayoutParams().addRule(android.widget.RelativeLayout.ALIGN_PARENT_TOP);
|
||||
gui.player_panel._global_status.setGravity(android.view.Gravity.LEFT | android.view.Gravity.CENTER);
|
||||
gui.player_panel._global_status.getLayoutParams().setMargins(0, 0, 0, dp * 1);
|
||||
gui.player_panel._global_status.setTextColor(gui.config.colors.sec_text);
|
||||
gui.player_panel._global_status.setTextColor(gui.config.colors[config.values.theme].sec_text);
|
||||
gui.player_panel._global_status.setTextSize(12);
|
||||
//gui.player_panel._global_status.setPadding(dp * 5, dp * 5, dp * 5, dp * 5);
|
||||
s.control_panel.addView(gui.player_panel._global_status);
|
||||
@@ -1750,7 +1797,7 @@ gui = {
|
||||
gui.player_panel._global_cnote.getLayoutParams().addRule(android.widget.RelativeLayout.BELOW, 14);
|
||||
gui.player_panel._global_cnote.setGravity(android.view.Gravity.LEFT | android.view.Gravity.CENTER);
|
||||
gui.player_panel._global_cnote.getLayoutParams().setMargins(0, dp * 1, 0, 0);
|
||||
gui.player_panel._global_cnote.setTextColor(gui.config.colors.sec_text);
|
||||
gui.player_panel._global_cnote.setTextColor(gui.config.colors[config.values.theme].sec_text);
|
||||
gui.player_panel._global_cnote.setTextSize(12);
|
||||
//gui.player_panel._global_cnote.setPadding(dp * 5, dp * 5, dp * 5, dp * 5);
|
||||
s.control_panel.addView(gui.player_panel._global_cnote);
|
||||
@@ -2010,13 +2057,173 @@ gui.dialogs.showProgressDialog(function(o) {
|
||||
o.setText(msg);
|
||||
}
|
||||
});
|
||||
config.updateBitmapTheme();
|
||||
gui.addViewMaker("sheetInfo", function(item) {
|
||||
var scr = new android.widget.ScrollView(ctx);
|
||||
scr.setBackgroundColor(gui.config.colors[config.values.theme].background);
|
||||
var layout = new android.widget.LinearLayout(ctx);
|
||||
layout.setLayoutParams(new android.widget.FrameLayout.LayoutParams(-2, -2));
|
||||
layout.setOrientation(android.widget.LinearLayout.VERTICAL);
|
||||
layout.setPadding(15 * dp, 15 * dp, 15 * dp, 15 * dp);
|
||||
var title = new android.widget.TextView(ctx);
|
||||
title.setText(item.name);
|
||||
title.setLayoutParams(new android.widget.LinearLayout.LayoutParams(-2, -2));
|
||||
title.setPadding(0, 0, 0, 10 * dp);
|
||||
title.setGravity(android.view.Gravity.LEFT | android.view.Gravity.CENTER);
|
||||
title.setTextColor(gui.config.colors[config.values.theme].text);
|
||||
title.setTextSize(20);
|
||||
title.getLayoutParams().setMargins(0, 0, 0, 7.5 * dp);
|
||||
layout.addView(title);
|
||||
var infoLayout = new android.widget.RelativeLayout(ctx);
|
||||
infoLayout.setLayoutParams(new android.widget.FrameLayout.LayoutParams(-2, -2));
|
||||
infoLayout.setPadding(10 * dp, 10 * dp, 10 * dp, 10 * dp);
|
||||
var authorImg = new android.widget.ImageView(ctx);
|
||||
authorImg.setId(10);
|
||||
authorImg.setLayoutParams(new android.widget.RelativeLayout.LayoutParams(dp * 38, dp * 38));
|
||||
authorImg.measure(0, 0);
|
||||
authorImg.setPadding(dp * 5, dp * 5, dp * 5, dp * 5);
|
||||
authorImg.setImageBitmap(config.bitmaps.user);
|
||||
authorImg.getLayoutParams().setMargins(0, 0, dp * 7.5, dp * 5);
|
||||
var authorText = new android.widget.TextView(ctx);
|
||||
authorText.setId(11);
|
||||
authorText.setText(android.text.Html.fromHtml((item.author.length == 0 ? "<font color=#7B7B7B>Not Provided</font>" : item.author)));
|
||||
authorText.setLayoutParams(new android.widget.RelativeLayout.LayoutParams(-2, dp * 38));
|
||||
authorText.getLayoutParams().addRule(android.widget.RelativeLayout.RIGHT_OF, 10);
|
||||
authorText.setPadding(0, 0, 0, 0);
|
||||
authorText.setGravity(android.view.Gravity.LEFT | android.view.Gravity.CENTER);
|
||||
authorText.setTextColor(gui.config.colors[config.values.theme].text);
|
||||
authorText.setTextSize(16);
|
||||
authorText.getLayoutParams().setMargins(dp * 7.5, 0, 0, dp * 5);
|
||||
var noteImg = new android.widget.ImageView(ctx);
|
||||
noteImg.setId(12);
|
||||
noteImg.setLayoutParams(new android.widget.RelativeLayout.LayoutParams(dp * 38, dp * 38));
|
||||
noteImg.getLayoutParams().addRule(android.widget.RelativeLayout.BELOW, 10);
|
||||
noteImg.measure(0, 0);
|
||||
noteImg.setPadding(dp * 5, dp * 5, dp * 5, dp * 5);
|
||||
noteImg.setImageBitmap(config.bitmaps.piano);
|
||||
noteImg.getLayoutParams().setMargins(0, dp * 5, dp * 7.5, dp * 5);
|
||||
var noteText = new android.widget.TextView(ctx);
|
||||
noteText.setId(13);
|
||||
noteText.setText((item.noteCount ? item.noteCount : item.songNotes.length) + " notes");
|
||||
noteText.setLayoutParams(new android.widget.RelativeLayout.LayoutParams(-2, dp * 38));
|
||||
noteText.getLayoutParams().addRule(android.widget.RelativeLayout.RIGHT_OF, 12);
|
||||
noteText.getLayoutParams().addRule(android.widget.RelativeLayout.BELOW, 11);
|
||||
noteText.setPadding(0, 0, 0, 0);
|
||||
noteText.setGravity(android.view.Gravity.LEFT | android.view.Gravity.CENTER);
|
||||
noteText.setTextColor(gui.config.colors[config.values.theme].text);
|
||||
noteText.setTextSize(16);
|
||||
noteText.getLayoutParams().setMargins(dp * 7.5, dp * 5, 0, dp * 5);
|
||||
var pitchImg = new android.widget.ImageView(ctx);
|
||||
pitchImg.setId(14);
|
||||
pitchImg.setLayoutParams(new android.widget.RelativeLayout.LayoutParams(dp * 38, dp * 38));
|
||||
pitchImg.getLayoutParams().addRule(android.widget.RelativeLayout.BELOW, 12);
|
||||
pitchImg.measure(0, 0);
|
||||
pitchImg.setPadding(dp * 5, dp * 5, dp * 5, dp * 5);
|
||||
pitchImg.setImageBitmap(config.bitmaps.note);
|
||||
pitchImg.getLayoutParams().setMargins(0, dp * 5, dp * 7.5, dp * 5);
|
||||
var pitchText = new android.widget.TextView(ctx);
|
||||
pitchText.setId(15);
|
||||
pitchText.setText(android.text.Html.fromHtml((function(){
|
||||
var r = "<font color=";
|
||||
switch(item.pitchLevel) {
|
||||
case 0: r += "#FF6100";break;
|
||||
case 1: r += "#FF9200";break;
|
||||
case 2: r += "#FFC600";break;
|
||||
case 3: r += "#FFFF00";break;
|
||||
case 4: r += "#8CC619";break;
|
||||
case 5: r += "#00815A";break;
|
||||
case 6: r += "#0096B5";break;
|
||||
case 7: r += "#2971B5";break;
|
||||
case 8: r += "#424DA4";break;
|
||||
case 9: r += "#6B3594";break;
|
||||
case 10: r += "#C5047B";break;
|
||||
case 11: r += "#FF0000";break;
|
||||
}
|
||||
r += (">" + sheetmgr.pitch_suggestion[item.pitchLevel].name + "</font>");
|
||||
return r;
|
||||
}())));
|
||||
pitchText.setLayoutParams(new android.widget.RelativeLayout.LayoutParams(-2, dp * 38));
|
||||
pitchText.getLayoutParams().addRule(android.widget.RelativeLayout.RIGHT_OF, 14);
|
||||
pitchText.getLayoutParams().addRule(android.widget.RelativeLayout.BELOW, 13);
|
||||
pitchText.setPadding(0, 0, 0, 0);
|
||||
pitchText.setGravity(android.view.Gravity.LEFT | android.view.Gravity.CENTER);
|
||||
pitchText.setTextColor(gui.config.colors[config.values.theme].text);
|
||||
pitchText.setTextSize(16);
|
||||
pitchText.getLayoutParams().setMargins(dp * 7.5, dp * 5, 0, dp * 5);
|
||||
infoLayout.addView(authorImg);
|
||||
infoLayout.addView(authorText);
|
||||
infoLayout.addView(noteImg);
|
||||
infoLayout.addView(noteText);
|
||||
infoLayout.addView(pitchImg);
|
||||
infoLayout.addView(pitchText);
|
||||
if(item.songNotes) {
|
||||
var timeImg = new android.widget.ImageView(ctx);
|
||||
timeImg.setId(16);
|
||||
timeImg.setLayoutParams(new android.widget.RelativeLayout.LayoutParams(dp * 38, dp * 38));
|
||||
timeImg.getLayoutParams().addRule(android.widget.RelativeLayout.BELOW, 14);
|
||||
timeImg.measure(0, 0);
|
||||
timeImg.setPadding(dp * 5, dp * 5, dp * 5, dp * 5);
|
||||
timeImg.setImageBitmap(config.bitmaps.clock);
|
||||
timeImg.getLayoutParams().setMargins(0, dp * 5, dp * 7.5, 0);
|
||||
var timeText = new android.widget.TextView(ctx);
|
||||
timeText.setId(17);
|
||||
timeText.setText((function(){
|
||||
var time_ms = item.songNotes[item.songNotes.length - 1].time;
|
||||
var second_s = Math.floor(time_ms / 1000);
|
||||
|
||||
var millis = time_ms - second_s * 1000;
|
||||
var minute = Math.floor(second_s / 60);
|
||||
var second = second_s - minute * 60;
|
||||
|
||||
return minute + ":" + second + "." + millis;
|
||||
}()));
|
||||
timeText.setLayoutParams(new android.widget.RelativeLayout.LayoutParams(-2, dp * 38));
|
||||
timeText.getLayoutParams().addRule(android.widget.RelativeLayout.RIGHT_OF, 16);
|
||||
timeText.getLayoutParams().addRule(android.widget.RelativeLayout.BELOW, 15);
|
||||
timeText.setPadding(0, 0, 0, 0);
|
||||
timeText.setGravity(android.view.Gravity.LEFT | android.view.Gravity.CENTER);
|
||||
timeText.setTextColor(gui.config.colors[config.values.theme].text);
|
||||
timeText.setTextSize(16);
|
||||
timeText.getLayoutParams().setMargins(dp * 7.5, dp * 5, 0, 0);
|
||||
infoLayout.addView(timeImg);
|
||||
infoLayout.addView(timeText);
|
||||
}
|
||||
infoLayout.measure(0, 0);
|
||||
layout.addView(infoLayout);
|
||||
|
||||
var sugPrompt = new android.widget.TextView(ctx);
|
||||
sugPrompt.setText("建议弹奏地点:");
|
||||
sugPrompt.setLayoutParams(new android.widget.LinearLayout.LayoutParams(-2, -2));
|
||||
sugPrompt.setGravity(android.view.Gravity.LEFT | android.view.Gravity.CENTER);
|
||||
sugPrompt.setTextColor(gui.config.colors[config.values.theme].text);
|
||||
sugPrompt.setTextSize(16);
|
||||
sugPrompt.getLayoutParams().setMargins(0, 5 * dp, 0, 5 * dp);
|
||||
layout.addView(sugPrompt);
|
||||
|
||||
var sug = new android.widget.TextView(ctx);
|
||||
sug.setText((function(){
|
||||
var r = "";
|
||||
sheetmgr.pitch_suggestion[item.pitchLevel].places.map(function(e, i) {
|
||||
r += ((i == 0 ? "" : "\n") + "• " + e)
|
||||
});
|
||||
return r;
|
||||
}()));
|
||||
sug.setLayoutParams(new android.widget.LinearLayout.LayoutParams(-2, -2));
|
||||
sug.setGravity(android.view.Gravity.LEFT | android.view.Gravity.CENTER);
|
||||
sug.setTextColor(gui.config.colors[config.values.theme].sec_text);
|
||||
sug.setTextSize(15);
|
||||
sug.getLayoutParams().setMargins(7 * dp, 5 * dp, 0, 0);
|
||||
layout.addView(sug);
|
||||
scr.addView(layout);
|
||||
return scr;
|
||||
});
|
||||
gui.main.addPage({
|
||||
index: 0,
|
||||
title: "本地乐谱",
|
||||
navigation_title: "本地乐谱",
|
||||
navigation_icon: config.bitmaps.local,
|
||||
navigation_icon: "local",
|
||||
func: [{
|
||||
icon: android.graphics.Bitmap.createBitmap(config.bitmaps.refresh),
|
||||
icon: "refresh",
|
||||
onClick: function(s, selfContent) {
|
||||
selfContent.getSheetList(s, true);
|
||||
},
|
||||
@@ -2049,7 +2256,7 @@ gui.dialogs.showProgressDialog(function(o) {
|
||||
element.v_upload.getLayoutParams().addRule(android.widget.RelativeLayout.CENTER_VERTICAL);
|
||||
element.v_upload.getLayoutParams().addRule(android.widget.RelativeLayout.RIGHT_OF, 10);
|
||||
element.v_upload.setTextSize(13);
|
||||
element.v_upload.setTextColor(gui.config.colors.sec_text);
|
||||
element.v_upload.setTextColor(gui.config.colors[config.values.theme].sec_text);
|
||||
element.v_upload.setText(element.title);
|
||||
element.v_relative.addView(element.v_upload);
|
||||
return element.v_relative;
|
||||
@@ -2063,7 +2270,7 @@ gui.dialogs.showProgressDialog(function(o) {
|
||||
element.v_title.getLayoutParams().addRule(android.widget.RelativeLayout.ALIGN_PARENT_LEFT);
|
||||
if(element.failed) element.v_title.getLayoutParams().addRule(android.widget.RelativeLayout.CENTER_VERTICAL);
|
||||
element.v_title.setTextSize(16);
|
||||
element.v_title.setTextColor(element.failed ? gui.config.colors.sec_text : gui.config.colors.text);
|
||||
element.v_title.setTextColor(element.failed ? gui.config.colors[config.values.theme].sec_text : gui.config.colors[config.values.theme].text);
|
||||
element.v_title.setText(element.failed ? android.text.Html.fromHtml("<s>" + element.fileName + "</s>") : element.name);
|
||||
element.v_relative.addView(element.v_title);
|
||||
|
||||
@@ -2075,7 +2282,7 @@ gui.dialogs.showProgressDialog(function(o) {
|
||||
element.v_author.getLayoutParams().addRule(android.widget.RelativeLayout.BELOW, 10);
|
||||
element.v_author.getLayoutParams().addRule(android.widget.RelativeLayout.ALIGN_PARENT_LEFT);
|
||||
element.v_author.setTextSize(14);
|
||||
element.v_author.setTextColor(gui.config.colors.sec_text);
|
||||
element.v_author.setTextColor(gui.config.colors[config.values.theme].sec_text);
|
||||
element.v_author.setText("键数: " + element.songNotes.length + " - BPM: " + element.bpm);
|
||||
element.v_relative.addView(element.v_author);
|
||||
|
||||
@@ -2237,70 +2444,7 @@ gui.dialogs.showProgressDialog(function(o) {
|
||||
});
|
||||
return;
|
||||
}
|
||||
gui.dialogs.showDialog((function () {
|
||||
var scr = new android.widget.ScrollView(ctx);
|
||||
scr.setBackgroundColor(gui.config.colors.background);
|
||||
var layout = new android.widget.LinearLayout(ctx);
|
||||
layout.setLayoutParams(new android.widget.FrameLayout.LayoutParams(-2, -2));
|
||||
layout.setOrientation(android.widget.LinearLayout.VERTICAL);
|
||||
layout.setPadding(15 * dp, 15 * dp, 15 * dp, 5 * dp);
|
||||
var title = new android.widget.TextView(ctx);
|
||||
title.setText(item.name);
|
||||
title.setLayoutParams(new android.widget.LinearLayout.LayoutParams(-2, -2));
|
||||
title.setPadding(0, 0, 0, 10 * dp);
|
||||
title.setTextColor(gui.config.colors.text);
|
||||
title.setTextSize(16);
|
||||
layout.addView(title);
|
||||
var text = new android.widget.TextView(ctx);
|
||||
text.setText(android.text.Html.fromHtml(
|
||||
"<font color=#FFFFFF>作者: " + (item.author.length == 0 ? "</font><font color=#7B7B7B>Not Provided</font><font color=#FFFFFF>" : item.author) + "</font><br>" +
|
||||
"<font color=#FFFFFF>BPM: " + item.bpm + "</font><br>" +
|
||||
"<font color=#FFFFFF>时长: " + (function(){
|
||||
var time_ms = item.songNotes[item.songNotes.length - 1].time;
|
||||
var second_s = Math.floor(time_ms / 1000);
|
||||
|
||||
var millis = time_ms - second_s * 1000;
|
||||
var minute = Math.floor(second_s / 60);
|
||||
var second = second_s - minute * 60;
|
||||
|
||||
return minute + ":" + second + "." + millis;
|
||||
}()) + "</font><br>" +
|
||||
"<br>" +
|
||||
"<font color=#FFFFFF>音高: " + (function(){
|
||||
var r = "</font><font color=";
|
||||
switch(item.pitchLevel) {
|
||||
case 0: r += "#FF6100";break;
|
||||
case 1: r += "#FF9200";break;
|
||||
case 2: r += "#FFC600";break;
|
||||
case 3: r += "#FFFF00";break;
|
||||
case 4: r += "#8CC619";break;
|
||||
case 5: r += "#00815A";break;
|
||||
case 6: r += "#0096B5";break;
|
||||
case 7: r += "#2971B5";break;
|
||||
case 8: r += "#424DA4";break;
|
||||
case 9: r += "#6B3594";break;
|
||||
case 10: r += "#C5047B";break;
|
||||
case 11: r += "#FF0000";break;
|
||||
}
|
||||
r += ">" + sheetmgr.pitch_suggestion[item.pitchLevel].name
|
||||
return r;
|
||||
}()) + "</font><br>" +
|
||||
"<font color=#FFFFFF>建议弹奏地点: " + (function(){
|
||||
var r = "</font>";
|
||||
sheetmgr.pitch_suggestion[item.pitchLevel].places.map(function(e, i) {
|
||||
r += "<br><font color=#FFFFFF> * </font><font color=#7B7B7B>" + e + "</font>"
|
||||
});
|
||||
return r;
|
||||
}())
|
||||
));
|
||||
text.setPadding(0, 0, 0, 10 * dp);
|
||||
text.setLayoutParams(new android.widget.LinearLayout.LayoutParams(-2, -2));
|
||||
text.setTextColor(gui.config.colors.sec_text);
|
||||
text.setTextSize(14);
|
||||
layout.addView(text);
|
||||
scr.addView(layout)
|
||||
return scr;
|
||||
}()), -2, -2, null, true);
|
||||
gui.dialogs.showDialog(gui.getViewMaker("sheetInfo")(item), -2, -2, null, true);
|
||||
}
|
||||
}));
|
||||
s.ns0_listView.setOnItemLongClickListener(new android.widget.AdapterView.OnItemLongClickListener({
|
||||
@@ -2335,7 +2479,7 @@ gui.dialogs.showProgressDialog(function(o) {
|
||||
s.ns0_progress.setPadding(0, 0, 0, 0);
|
||||
s.ns0_progress.getLayoutParams().setMargins(0, 0, 0, 0);
|
||||
s.ns0_progress.getLayoutParams().addRule(android.widget.RelativeLayout.ALIGN_PARENT_BOTTOM);
|
||||
s.ns0_progress.setProgressDrawable(new android.graphics.drawable.ColorDrawable(gui.config.colors.background));
|
||||
s.ns0_progress.setProgressDrawable(new android.graphics.drawable.ColorDrawable(gui.config.colors[config.values.theme].background));
|
||||
s.ns0_progress.setIndeterminate(true);
|
||||
s.ns0_progress.setAlpha(0);
|
||||
|
||||
@@ -2405,9 +2549,9 @@ gui.dialogs.showProgressDialog(function(o) {
|
||||
index: 1,
|
||||
title: "共享乐谱",
|
||||
navigation_title: "共享乐谱",
|
||||
navigation_icon: config.bitmaps.online,
|
||||
navigation_icon: "online",
|
||||
func: [{
|
||||
icon: android.graphics.Bitmap.createBitmap(config.bitmaps.refresh),
|
||||
icon: "refresh",
|
||||
onClick: function(s, selfContent) {
|
||||
if(s.ns1_isShowingSearchEditTextView) selfContent.removeSearchEditTextView(s, selfContent);
|
||||
selfContent.getOnlineSheetList(s, true);
|
||||
@@ -2418,7 +2562,7 @@ gui.dialogs.showProgressDialog(function(o) {
|
||||
toast("Click filter")
|
||||
},
|
||||
},*/ {
|
||||
icon: android.graphics.Bitmap.createBitmap(config.bitmaps.search),
|
||||
icon: "search",
|
||||
onClick: function(s, selfContent) {
|
||||
if(s.ns1_isShowingSearchEditTextView) {
|
||||
selfContent.removeSearchEditTextView(s, selfContent);
|
||||
@@ -2461,7 +2605,7 @@ gui.dialogs.showProgressDialog(function(o) {
|
||||
element.v_upload.getLayoutParams().addRule(android.widget.RelativeLayout.CENTER_VERTICAL);
|
||||
element.v_upload.getLayoutParams().addRule(android.widget.RelativeLayout.RIGHT_OF, 10);
|
||||
element.v_upload.setTextSize(13);
|
||||
element.v_upload.setTextColor(gui.config.colors.sec_text);
|
||||
element.v_upload.setTextColor(gui.config.colors[config.values.theme].sec_text);
|
||||
element.v_upload.setText(element.title);
|
||||
element.v_relative.addView(element.v_upload);
|
||||
};break;
|
||||
@@ -2477,7 +2621,7 @@ gui.dialogs.showProgressDialog(function(o) {
|
||||
element.v_title.getLayoutParams().setMargins(dp * 15, dp * 15, dp * 15, dp * 1);
|
||||
element.v_title.getLayoutParams().addRule(android.widget.RelativeLayout.ALIGN_PARENT_LEFT);
|
||||
element.v_title.setTextSize(16);
|
||||
element.v_title.setTextColor(gui.config.colors.text);
|
||||
element.v_title.setTextColor(gui.config.colors[config.values.theme].text);
|
||||
element.v_title.setText(element.name);
|
||||
element.v_relative.addView(element.v_title);
|
||||
|
||||
@@ -2488,7 +2632,7 @@ gui.dialogs.showProgressDialog(function(o) {
|
||||
element.v_info.getLayoutParams().addRule(android.widget.RelativeLayout.BELOW, 10);
|
||||
element.v_info.getLayoutParams().addRule(android.widget.RelativeLayout.ALIGN_PARENT_LEFT);
|
||||
element.v_info.setTextSize(15);
|
||||
element.v_info.setTextColor(gui.config.colors.text);
|
||||
element.v_info.setTextColor(gui.config.colors[config.values.theme].text);
|
||||
element.v_info.setText(element.author);
|
||||
element.v_relative.addView(element.v_info);
|
||||
|
||||
@@ -2499,7 +2643,7 @@ gui.dialogs.showProgressDialog(function(o) {
|
||||
element.v_desc.getLayoutParams().addRule(android.widget.RelativeLayout.BELOW, 11);
|
||||
element.v_desc.getLayoutParams().addRule(android.widget.RelativeLayout.ALIGN_PARENT_LEFT);
|
||||
element.v_desc.setTextSize(13);
|
||||
element.v_desc.setTextColor(gui.config.colors.sec_text);
|
||||
element.v_desc.setTextColor(gui.config.colors[config.values.theme].sec_text);
|
||||
element.v_desc.setText(android.text.Html.fromHtml(element.desc.replace(new RegExp("\x0a", "gi"), "<br>")));
|
||||
element.v_relative.addView(element.v_desc);
|
||||
|
||||
@@ -2584,7 +2728,7 @@ gui.dialogs.showProgressDialog(function(o) {
|
||||
element.v_status.getLayoutParams().addRule(android.widget.RelativeLayout.ALIGN_PARENT_LEFT);
|
||||
element.v_status.setTextSize(13);
|
||||
element.v_status.setAlpha(0);
|
||||
element.v_status.setTextColor(gui.config.colors.text);
|
||||
element.v_status.setTextColor(gui.config.colors[config.values.theme].text);
|
||||
|
||||
element.v_progress = new android.widget.ProgressBar(ctx, null, android.R.attr.progressBarStyleHorizontal);
|
||||
element.v_progress.setLayoutParams(new android.widget.RelativeLayout.LayoutParams(-1, dp * 15));
|
||||
@@ -2592,7 +2736,7 @@ gui.dialogs.showProgressDialog(function(o) {
|
||||
element.v_progress.getLayoutParams().addRule(android.widget.RelativeLayout.BELOW, 13);
|
||||
element.v_progress.getLayoutParams().setMargins(dp * 15, 0, dp * 15, dp * 5);
|
||||
element.v_progress.getLayoutParams().addRule(android.widget.RelativeLayout.ALIGN_PARENT_BOTTOM);
|
||||
element.v_progress.setProgressDrawable(new android.graphics.drawable.ColorDrawable(gui.config.colors.background));
|
||||
element.v_progress.setProgressDrawable(new android.graphics.drawable.ColorDrawable(gui.config.colors[config.values.theme].background));
|
||||
element.v_progress.setIndeterminate(false);
|
||||
element.v_progress.setAlpha(0);
|
||||
};break;
|
||||
@@ -2659,64 +2803,7 @@ gui.dialogs.showProgressDialog(function(o) {
|
||||
|
||||
};break;
|
||||
default: {
|
||||
gui.dialogs.showDialog((function () {
|
||||
var scr = new android.widget.ScrollView(ctx);
|
||||
scr.setBackgroundColor(gui.config.colors.background);
|
||||
var layout = new android.widget.LinearLayout(ctx);
|
||||
layout.setLayoutParams(new android.widget.FrameLayout.LayoutParams(-2, -2));
|
||||
layout.setOrientation(android.widget.LinearLayout.VERTICAL);
|
||||
layout.setPadding(15 * dp, 15 * dp, 15 * dp, 5 * dp);
|
||||
var title = new android.widget.TextView(ctx);
|
||||
title.setText(item.name);
|
||||
title.setLayoutParams(new android.widget.LinearLayout.LayoutParams(-2, -2));
|
||||
title.setPadding(0, 0, 0, 10 * dp);
|
||||
title.setTextColor(gui.config.colors.text);
|
||||
title.setTextSize(16);
|
||||
layout.addView(title);
|
||||
var text = new android.widget.TextView(ctx);
|
||||
text.setText(android.text.Html.fromHtml(
|
||||
"<font color=#FFFFFF>作者: " + (item.author.length == 0 ? "</font><font color=#7B7B7B>Not Provided</font><font color=#FFFFFF>" : item.author) + "</font><br>" +
|
||||
"<font color=#FFFFFF>BPM: " + item.bpm + "</font><br>" +
|
||||
"<br>" +
|
||||
"<font color=#FFFFFF>音高: " + (function(){
|
||||
var r = "</font><font color=";
|
||||
switch(item.pitchLevel) {
|
||||
case 0: r += "#FF6100";break;
|
||||
case 1: r += "#FF9200";break;
|
||||
case 2: r += "#FFC600";break;
|
||||
case 3: r += "#FFFF00";break;
|
||||
case 4: r += "#8CC619";break;
|
||||
case 5: r += "#00815A";break;
|
||||
case 6: r += "#0096B5";break;
|
||||
case 7: r += "#2971B5";break;
|
||||
case 8: r += "#424DA4";break;
|
||||
case 9: r += "#6B3594";break;
|
||||
case 10: r += "#C5047B";break;
|
||||
case 11: r += "#FF0000";break;
|
||||
}
|
||||
r += ">" + sheetmgr.pitch_suggestion[item.pitchLevel].name
|
||||
return r;
|
||||
}()) + "</font><br>" +
|
||||
"<font color=#FFFFFF>建议弹奏地点: " + (function(){
|
||||
var r = "</font>";
|
||||
sheetmgr.pitch_suggestion[item.pitchLevel].places.map(function(e, i) {
|
||||
r += "<br><font color=#FFFFFF> * </font><font color=#7B7B7B>" + e + "</font>"
|
||||
});
|
||||
return r;
|
||||
}()) +
|
||||
"<br><br>" +
|
||||
"<font color=#FFFFFF>简介: </font><br><font color=#7B7B7B>" +
|
||||
item.desc.replace(new RegExp("\x0a", "gi"), "<br>")
|
||||
+ "</font>"
|
||||
));
|
||||
text.setPadding(0, 0, 0, 10 * dp);
|
||||
text.setLayoutParams(new android.widget.LinearLayout.LayoutParams(-2, -2));
|
||||
text.setTextColor(gui.config.colors.sec_text);
|
||||
text.setTextSize(14);
|
||||
layout.addView(text);
|
||||
scr.addView(layout)
|
||||
return scr;
|
||||
}()), -2, -2, null, true);
|
||||
gui.dialogs.showDialog(gui.getViewMaker("sheetInfo")(item), -2, -2, null, true);
|
||||
}break;
|
||||
}
|
||||
return true;
|
||||
@@ -2730,7 +2817,7 @@ gui.dialogs.showProgressDialog(function(o) {
|
||||
s.ns1_progress.setPadding(0, 0, 0, 0);
|
||||
s.ns1_progress.getLayoutParams().setMargins(0, 0, 0, 0);
|
||||
s.ns1_progress.getLayoutParams().addRule(android.widget.RelativeLayout.ALIGN_PARENT_BOTTOM);
|
||||
s.ns1_progress.setProgressDrawable(new android.graphics.drawable.ColorDrawable(gui.config.colors.background));
|
||||
s.ns1_progress.setProgressDrawable(new android.graphics.drawable.ColorDrawable(gui.config.colors[config.values.theme].background));
|
||||
s.ns1_progress.setIndeterminate(true);
|
||||
s.ns1_progress.setAlpha(0);
|
||||
|
||||
@@ -2751,8 +2838,8 @@ gui.dialogs.showProgressDialog(function(o) {
|
||||
s.ns1_searchEditText.setPadding(dp * 5, dp * 5, dp * 5, dp * 5);
|
||||
s.ns1_searchEditText.getLayoutParams().addRule(android.widget.RelativeLayout.ALIGN_PARENT_LEFT);
|
||||
s.ns1_searchEditText.setTextSize(15);
|
||||
s.ns1_searchEditText.setTextColor(gui.config.colors.text);
|
||||
s.ns1_searchEditText.setHintTextColor(gui.config.colors.sec_text);
|
||||
s.ns1_searchEditText.setTextColor(gui.config.colors[config.values.theme].text);
|
||||
s.ns1_searchEditText.setHintTextColor(gui.config.colors[config.values.theme].sec_text);
|
||||
s.ns1_searchEditText.setHint("按回车开始搜索");
|
||||
s.ns1_searchEditText.setAlpha(0);
|
||||
s.ns1_searchEditText.setOnClickListener(new android.view.View.OnClickListener({
|
||||
@@ -2867,7 +2954,7 @@ gui.dialogs.showProgressDialog(function(o) {
|
||||
index: 2,
|
||||
title: "设置",
|
||||
navigation_title: "设置",
|
||||
navigation_icon: config.bitmaps.settings,
|
||||
navigation_icon: "settings",
|
||||
view: function(s) {
|
||||
s.ns2_listView = new android.widget.ListView(ctx);
|
||||
s.ns2_listView.setLayoutParams(new android.widget.LinearLayout.LayoutParams(-1, s._content_height));
|
||||
@@ -2915,6 +3002,24 @@ gui.dialogs.showProgressDialog(function(o) {
|
||||
onClick: function(checked) {
|
||||
config.values.tipOnAndroidR = config.save("tip_storage_on_android_r", checked);
|
||||
}
|
||||
}, {
|
||||
type: "default",
|
||||
name: "设置主题色",
|
||||
onClick: function(v) {
|
||||
gui.dialogs.showOperateDialog([{
|
||||
text: "亮色"
|
||||
}, {
|
||||
text: "暗色"
|
||||
}], function(pos) {
|
||||
config.values.theme = config.save("theme", pos == 1 ? "dark" : "light");
|
||||
config.updateBitmapTheme();
|
||||
gui.main.__internal_dismiss();
|
||||
var handler = new android.os.Handler();
|
||||
handler.postDelayed(function (){
|
||||
gui.main.show(gui.main.current);
|
||||
}, 500);
|
||||
});
|
||||
}
|
||||
}, {
|
||||
type: "tag",
|
||||
name: "关于",
|
||||
@@ -2944,6 +3049,21 @@ gui.dialogs.showProgressDialog(function(o) {
|
||||
});
|
||||
});
|
||||
},
|
||||
}, {
|
||||
type: "default",
|
||||
name: "查看更新日志",
|
||||
onClick: function(v) {
|
||||
threads.start(function() {
|
||||
config.fetchRepoFile("update_log.txt", null, function(body) {
|
||||
gui.dialogs.showConfirmDialog({
|
||||
title: "更新日志",
|
||||
text: body.string(),
|
||||
canExit: true,
|
||||
buttons: ["确认"],
|
||||
});
|
||||
});
|
||||
});
|
||||
},
|
||||
}, {
|
||||
type: "default",
|
||||
name: "结束脚本运行",
|
||||
@@ -2973,7 +3093,7 @@ gui.dialogs.showProgressDialog(function(o) {
|
||||
element.v_title.getLayoutParams().setMargins(dp * 5, dp * 5, dp * 5, dp * 5);
|
||||
element.v_title.getLayoutParams().addRule(android.widget.RelativeLayout.ALIGN_PARENT_LEFT);
|
||||
element.v_title.setTextSize(12);
|
||||
element.v_title.setTextColor(gui.config.colors.sec_text);
|
||||
element.v_title.setTextColor(gui.config.colors[config.values.theme].sec_text);
|
||||
element.v_title.setText(element.name);
|
||||
element.v_relative.addView(element.v_title);
|
||||
break;
|
||||
@@ -2984,7 +3104,7 @@ gui.dialogs.showProgressDialog(function(o) {
|
||||
element.v_title.getLayoutParams().setMargins(dp * 10, dp * 10, dp * 10, dp * 10);
|
||||
element.v_title.getLayoutParams().addRule(android.widget.RelativeLayout.ALIGN_PARENT_LEFT);
|
||||
element.v_title.setTextSize(14);
|
||||
element.v_title.setTextColor(gui.config.colors.text);
|
||||
element.v_title.setTextColor(gui.config.colors[config.values.theme].text);
|
||||
element.v_title.setText(element.name);
|
||||
element.v_relative.addView(element.v_title);
|
||||
break;
|
||||
@@ -2996,7 +3116,7 @@ gui.dialogs.showProgressDialog(function(o) {
|
||||
element.v_title.getLayoutParams().addRule(android.widget.RelativeLayout.ALIGN_PARENT_LEFT);
|
||||
element.v_title.getLayoutParams().addRule(android.widget.RelativeLayout.CENTER_VERTICAL);
|
||||
element.v_title.setTextSize(14);
|
||||
element.v_title.setTextColor(gui.config.colors.text);
|
||||
element.v_title.setTextColor(gui.config.colors[config.values.theme].text);
|
||||
element.v_title.setText(element.name);
|
||||
element.v_relative.addView(element.v_title);
|
||||
|
||||
|
||||
@@ -1,3 +1,25 @@
|
||||
版本: 18
|
||||
更新时间: 2020.10.04 10:30
|
||||
更新内容:
|
||||
* 修复:修复了版本8遗留的文件编码问题
|
||||
(这个BUG导致SkyStudio打开下载的共享乐谱或者设置键位后的本地乐谱闪退)
|
||||
(如何修复已经会导致闪退的乐谱: )
|
||||
(对于下载的共享乐谱: 删除并重新下载)
|
||||
(对于已设置键位的本地乐谱: ① 使用MT管理器或其他文件管理器打开有问题的乐谱)
|
||||
(② 指定UTF-16LE编码重新加载)
|
||||
(③ 复制内容,新建一个文件并粘贴内容)
|
||||
(④ 指定UTF-16LE编码保存文件)
|
||||
|
||||
版本: 17
|
||||
更新时间: 2020.10.02 14:30
|
||||
更新内容:
|
||||
* 新增:亮暗色主题切换
|
||||
|
||||
版本: 16
|
||||
更新时间: 2020.10.02 12:50
|
||||
更新内容:
|
||||
* 改善:乐谱详情界面
|
||||
|
||||
版本: 15
|
||||
更新时间: 2020.10.01 00:00
|
||||
更新内容:
|
||||
|
||||
Reference in New Issue
Block a user