@@ -64,7 +64,7 @@ threads.start(function() {
sheetmgr = {
sheetmgr = {
rootDir : android . os . Environment . getExternalStorageDirectory ( ) + "/Android/data/com.Maple.SkyStudio/files/Sheet/" ,
rootDir : android . os . Environment . getExternalStorageDirectory ( ) + "/Android/data/com.Maple.SkyStudio/files/Sheet/" ,
encoding : "utf-16le " ,
encoding : "x-UTF-16LE-BOM " ,
cachedLocalSheetList : [ ] ,
cachedLocalSheetList : [ ] ,
cachedOnlineSharedSheetInfoList : [ ] ,
cachedOnlineSharedSheetInfoList : [ ] ,
@@ -101,6 +101,7 @@ sheetmgr = {
}
}
return stringBuffer . toString ( ) ;
return stringBuffer . toString ( ) ;
} ( 7 ) ) + ".txt" ) ;
} ( 7 ) ) + ".txt" ) ;
var parsed ;
var parsed ;
files . write ( sheet , parsed = ( function ( ) {
files . write ( sheet , parsed = ( function ( ) {
var data = eval ( body . string ( ) ) [ 0 ] ;
var data = eval ( body . string ( ) ) [ 0 ] ;
@@ -110,7 +111,6 @@ sheetmgr = {
return "[" + JSON . stringify ( data ) + "]" ;
return "[" + JSON . stringify ( data ) + "]" ;
} ( ) ) , sheetmgr . encoding ) ;
} ( ) ) , sheetmgr . encoding ) ;
parsed = eval ( parsed ) [ 0 ] ;
parsed = eval ( parsed ) [ 0 ] ;
//parsed.songNotes = sheetmgr.parseSongNote(parsed.songNotes);
parsed . fileName = sheet ;
parsed . fileName = sheet ;
sheetmgr . cachedLocalSheetList . push ( parsed ) ;
sheetmgr . cachedLocalSheetList . push ( parsed ) ;
listener ( { status : 3 } ) ;
listener ( { status : 3 } ) ;
@@ -345,6 +345,9 @@ config = {
_global _storage : null ,
_global _storage : null ,
values : {
values : {
currentVersion : 18 ,
gitVersion : "" ,
key _coordinates15 : [ ] ,
key _coordinates15 : [ ] ,
key _coordinates8 : [ ] ,
key _coordinates8 : [ ] ,
skipRunScriptTip : false ,
skipRunScriptTip : false ,
@@ -356,8 +359,7 @@ config = {
skipChangeKeyCountTip : false ,
skipChangeKeyCountTip : false ,
showFailedSheets : true ,
showFailedSheets : true ,
tipOnAndroidR : true ,
tipOnAndroidR : true ,
currentVersion : 16 ,
theme : "dark" ,
gitVersion : "" ,
} ,
} ,
bitmaps : { } ,
bitmaps : { } ,
@@ -376,6 +378,7 @@ config = {
this . values . skipChangeKeyCountTip = this . _global _storage . get ( "skip_change_key_count_tip" , this . values . skipChangeKeyCountTip ) ;
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 . 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 . 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 {
try {
android . os . Build . VERSION _CODES . R
android . os . Build . VERSION _CODES . R
@@ -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,10 +739,16 @@ gui = {
config : {
config : {
colors : {
colors : {
background : android . graphics . Color . parseColor ( "#212121" ) ,
dark : {
text : android . graphics . Color . parseColor ( "#FFFFFF " ) ,
background : android . graphics . Color . parseColor ( "#212121 " ) ,
dark _ text: android . graphics . Color . parseColor ( "#000000 " ) ,
text : android . graphics . Color . parseColor ( "#FFFFFF " ) ,
sec _text : android . graphics . Color . parseColor ( "#7B7B7B" ) ,
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" ) ,
} ,
} ,
} ,
} ,
} ,
@@ -807,11 +833,11 @@ gui = {
var layout = o . layout = new android . widget . LinearLayout ( ctx ) ;
var layout = o . layout = new android . widget . LinearLayout ( ctx ) ;
layout . setOrientation ( android . widget . LinearLayout . VERTICAL ) ;
layout . setOrientation ( android . widget . LinearLayout . VERTICAL ) ;
layout . setPadding ( dp * 10 , isNoText ? dp * 5 : dp * 10 , dp * 10 , isNoText ? dp * 5 : 0 ) ;
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 ) {
if ( ! isNoText ) {
var text = o . text = new android . widget . TextView ( ctx ) ;
var text = o . text = new android . widget . TextView ( ctx ) ;
text . setLayoutParams ( new android . widget . FrameLayout . LayoutParams ( - 2 , - 2 ) ) ;
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 ) ;
text . setPadding ( dp * 10 , dp * 10 , dp * 10 , dp * 10 ) ;
layout . addView ( text ) ;
layout . addView ( text ) ;
}
}
@@ -900,7 +926,7 @@ gui = {
try {
try {
var scr , layout , title , text , skip , onClick , dialog ;
var scr , layout , title , text , skip , onClick , dialog ;
scr = new android . widget . ScrollView ( ctx ) ;
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 = new android . widget . LinearLayout ( ctx ) ;
layout . setLayoutParams ( new android . widget . FrameLayout . LayoutParams ( - 2 , - 2 ) ) ;
layout . setLayoutParams ( new android . widget . FrameLayout . LayoutParams ( - 2 , - 2 ) ) ;
layout . setOrientation ( android . widget . LinearLayout . VERTICAL ) ;
layout . setOrientation ( android . widget . LinearLayout . VERTICAL ) ;
@@ -910,7 +936,7 @@ gui = {
title . setText ( s . title ) ;
title . setText ( s . title ) ;
title . setLayoutParams ( new android . widget . LinearLayout . LayoutParams ( - 2 , - 2 ) ) ;
title . setLayoutParams ( new android . widget . LinearLayout . LayoutParams ( - 2 , - 2 ) ) ;
title . setPadding ( 0 , 0 , 0 , 10 * dp ) ;
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 ) ;
title . setTextSize ( 16 ) ;
layout . addView ( title ) ;
layout . addView ( title ) ;
}
}
@@ -919,7 +945,7 @@ gui = {
text . setText ( s . text ) ;
text . setText ( s . text ) ;
text . setPadding ( 0 , 0 , 0 , 10 * dp ) ;
text . setPadding ( 0 , 0 , 0 , 10 * dp ) ;
text . setLayoutParams ( new android . widget . LinearLayout . LayoutParams ( - 2 , - 2 ) ) ;
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 ) ;
text . setTextSize ( 14 ) ;
layout . addView ( text ) ;
layout . addView ( text ) ;
}
}
@@ -929,7 +955,7 @@ gui = {
skip . setLayoutParams ( android . widget . LinearLayout . LayoutParams ( - 2 , - 2 , 0 ) ) ;
skip . setLayoutParams ( android . widget . LinearLayout . LayoutParams ( - 2 , - 2 , 0 ) ) ;
skip . getLayoutParams ( ) . setMargins ( 0 , 0 , 0 , 10 * dp )
skip . getLayoutParams ( ) . setMargins ( 0 , 0 , 0 , 10 * dp )
skip . setText ( "不再提示" ) ;
skip . setText ( "不再提示" ) ;
skip . setTextColor ( gui . config . colors . sec _text )
skip . setTextColor ( gui . config . colors [ config . values . theme ] .sec _text )
layout . addView ( skip ) ;
layout . addView ( skip ) ;
}
}
onClick = function ( i ) {
onClick = function ( i ) {
@@ -944,7 +970,7 @@ gui = {
b . setText ( String ( e ) ) ;
b . setText ( String ( e ) ) ;
b . setGravity ( android . view . Gravity . CENTER ) ;
b . setGravity ( android . view . Gravity . CENTER ) ;
b . setPadding ( 10 * dp , 10 * dp , 10 * dp , 10 * dp ) ;
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 . setTextSize ( 14 ) ;
b . measure ( 0 , 0 ) ;
b . measure ( 0 , 0 ) ;
b . setBackgroundDrawable ( gui . utils . ripple _drawable ( b . getMeasuredWidth ( ) , b . getMeasuredHeight ( ) , "rect" ) ) ;
b . setBackgroundDrawable ( gui . utils . ripple _drawable ( b . getMeasuredWidth ( ) , b . getMeasuredHeight ( ) , "rect" ) ) ;
@@ -986,7 +1012,7 @@ gui = {
e . _title . setFocusable ( false ) ;
e . _title . setFocusable ( false ) ;
e . _title . setLayoutParams ( new android . widget . LinearLayout . LayoutParams ( - 1 , - 2 ) ) ;
e . _title . setLayoutParams ( new android . widget . LinearLayout . LayoutParams ( - 1 , - 2 ) ) ;
e . _title . setTextSize ( 16 ) ;
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 ) ;
e . view . addView ( e . _title ) ;
if ( e . description ) {
if ( e . description ) {
e . _description = new android . widget . TextView ( ctx ) ;
e . _description = new android . widget . TextView ( ctx ) ;
@@ -994,7 +1020,7 @@ gui = {
e . _description . setPadding ( 0 , 3 * dp , 0 , 0 ) ;
e . _description . setPadding ( 0 , 3 * dp , 0 , 0 ) ;
e . _description . setLayoutParams ( android . widget . LinearLayout . LayoutParams ( - 1 , - 2 ) ) ;
e . _description . setLayoutParams ( android . widget . LinearLayout . LayoutParams ( - 1 , - 2 ) ) ;
e . _description . setTextSize ( 14 ) ;
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 ) ;
e . view . addView ( e . _description ) ;
}
}
return e . view ;
return e . view ;
@@ -1002,7 +1028,7 @@ gui = {
}
}
frame = new android . widget . FrameLayout ( ctx ) ;
frame = new android . widget . FrameLayout ( ctx ) ;
frame . setPadding ( 5 * dp , 5 * dp , 5 * dp , 5 * dp ) ;
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 = new android . widget . ListView ( ctx ) ;
list . setLayoutParams ( new android . widget . FrameLayout . LayoutParams ( - 1 , - 2 ) ) ;
list . setLayoutParams ( new android . widget . FrameLayout . LayoutParams ( - 1 , - 2 ) ) ;
list . setDividerHeight ( 0 ) ;
list . setDividerHeight ( 0 ) ;
@@ -1010,10 +1036,13 @@ gui = {
list . setOnItemClickListener ( new android . widget . AdapterView . OnItemClickListener ( {
list . setOnItemClickListener ( new android . widget . AdapterView . OnItemClickListener ( {
onItemClick : function ( parent , view , pos , id ) {
onItemClick : function ( parent , view , pos , id ) {
try {
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 ( ) ) ;
dialog . setAlpha ( anim . getAnimatedValue ( ) ) ;
if ( anim . getAnimatedValue ( ) == 1 ) gui . winMgr . removeView ( dialog ) ;
if ( anim . getAnimatedValue ( ) == 1 ) gui . winMgr . removeView ( dialog ) ;
} ) ;
} ) ;
}
return true ;
return true ;
} catch ( e ) {
} catch ( e ) {
error ( e + " → " + e . lineNumber ) ;
error ( e + " → " + e . lineNumber ) ;
@@ -1156,11 +1185,11 @@ gui = {
gui . main . _global _base . setGravity ( android . view . Gravity . CENTER | android . view . Gravity . CENTER ) ;
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 . 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 . 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 = 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 . 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 _statusbar . setElevation ( 10 * dp ) ;
gui . main . _global _title = new android . widget . TextView ( ctx ) ;
gui . main . _global _title = new android . widget . TextView ( ctx ) ;
@@ -1171,7 +1200,7 @@ gui = {
if ( content . title != null ) gui . main . _global _title . setText ( content . title ) ;
if ( content . title != null ) gui . main . _global _title . setText ( content . title ) ;
gui . main . _global _title . setTextSize ( 15 ) ;
gui . main . _global _title . setTextSize ( 15 ) ;
gui . main . _global _title . setShadowLayer ( dp * 5 , 0 , 0 , android . graphics . Color . BLACK ) ;
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 ( {
gui . main . _global _title . setOnTouchListener ( new android . view . View . OnTouchListener ( {
onTouch : function onTouchFunction ( view , event ) {
onTouch : function onTouchFunction ( view , event ) {
switch ( event . getAction ( ) ) {
switch ( event . getAction ( ) ) {
@@ -1202,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 . 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 . setText ( "× " ) ;
gui . main . _global _close . setTextSize ( 22 ) ;
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 ( {
gui . main . _global _close . setOnClickListener ( new android . view . View . OnClickListener ( {
onClick : function ( ) {
onClick : function ( ) {
gui . main . _ _internal _dismiss ( ) ;
gui . main . _ _internal _dismiss ( ) ;
@@ -1216,7 +1245,7 @@ gui = {
gui . main . _global _content _container = new android . widget . RelativeLayout ( ctx ) ;
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 . 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 ) ;
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 ) ;
gui . main . _global _content _container . measure ( 0 , 0 ) ;
@@ -1240,7 +1269,7 @@ gui = {
gui . main . _global _navigation _bar . setGravity ( android . view . Gravity . CENTER | android . view . Gravity . CENTER ) ;
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 . 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 . 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 ) ;
gui . main . _ _internal _genNavigationList ( s , content ) ;
@@ -1343,7 +1372,7 @@ gui = {
view . setBackgroundDrawable ( gui . utils . ripple _drawable ( view . getMeasuredWidth ( ) , view . getMeasuredHeight ( ) , "rect" ) ) ;
view . setBackgroundDrawable ( gui . utils . ripple _drawable ( view . getMeasuredWidth ( ) , view . getMeasuredHeight ( ) , "rect" ) ) ;
view . setPadding ( dp * 5 , dp * 5 , dp * 5 , dp * 5 ) ;
view . setPadding ( dp * 5 , dp * 5 , dp * 5 , dp * 5 ) ;
view . setAlpha ( 0 ) ;
view . setAlpha ( 0 ) ;
view . setImageBitmap ( content . func [ i ] . icon ) ;
view . setImageBitmap ( config . bitmaps [ content. func [ i ] . icon ] );
view . setOnClickListener ( new android . view . View . OnClickListener ( {
view . setOnClickListener ( new android . view . View . OnClickListener ( {
onClick : function ( view ) { content . func [ view . getId ( ) - ( gui . main . _global _close . getId ( ) + 1 ) ] . onClick ( s , content ) }
onClick : function ( view ) { content . func [ view . getId ( ) - ( gui . main . _global _close . getId ( ) + 1 ) ] . onClick ( s , content ) }
} ) ) ;
} ) ) ;
@@ -1388,12 +1417,12 @@ gui = {
s [ "navigationBtnText" + i ] . setText ( gui . main . views [ i ] . navigation _title ) ;
s [ "navigationBtnText" + i ] . setText ( gui . main . views [ i ] . navigation _title ) ;
s [ "navigationBtnText" + i ] . setTextSize ( 12 ) ;
s [ "navigationBtnText" + i ] . setTextSize ( 12 ) ;
s [ "navigationBtnText" + i ] . setShadowLayer ( dp , 0 , 0 , android . graphics . Color . BLACK ) ;
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 ] = new android . widget . ImageView ( ctx ) ;
s [ "navigationBtnImg" + i ] . setId ( 14 ) ;
s [ "navigationBtnImg" + i ] . setId ( 14 ) ;
s [ "navigationBtnImg" + i ] . setScaleType ( android . widget . ImageView . ScaleType . CENTER _CROP ) ;
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 . _ _navigationBtnImgHeight = ( function ( ) {
s [ "navigationBtnText" + i ] . measure ( 0 , 0 ) ;
s [ "navigationBtnText" + i ] . measure ( 0 , 0 ) ;
return dp * gui . main . navigation _bar _height - s [ "navigationBtnText" + i ] . getMeasuredHeight ( ) ;
return dp * gui . main . navigation _bar _height - s [ "navigationBtnText" + i ] . getMeasuredHeight ( ) ;
@@ -1409,11 +1438,11 @@ gui = {
if ( gui . main . _global _navigation _bar == null ) return ;
if ( gui . main . _global _navigation _bar == null ) return ;
if ( ! /^android/ . test ( String ( gui . main . _global _navigation _bar . findViewById ( s . index ) ) ) ) return ;
if ( ! /^android/ . test ( String ( gui . main . _global _navigation _bar . findViewById ( s . index ) ) ) ) return ;
if ( gui . main . current _navigation _selection == 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 . setDuration ( 300 ) ;
colorAnim . setEvaluator ( new android . animation . ArgbEvaluator ( ) ) ;
colorAnim . setEvaluator ( new android . animation . ArgbEvaluator ( ) ) ;
colorAnim . start ( ) ;
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 . setDuration ( 300 ) ;
colorAnim . setEvaluator ( new android . animation . ArgbEvaluator ( ) ) ;
colorAnim . setEvaluator ( new android . animation . ArgbEvaluator ( ) ) ;
colorAnim . start ( ) ;
colorAnim . start ( ) ;
@@ -1616,8 +1645,8 @@ gui = {
if ( ! gui . key _coordinate _navigation . isShowingText ) {
if ( ! gui . key _coordinate _navigation . isShowingText ) {
gui . key _coordinate _navigation . _global _text = new android . widget . TextView ( ctx ) ;
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 . 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 . setTextColor ( gui . config . colors [ config . values . theme ] .text ) ;
gui . key _coordinate _navigation . _global _text . setBackgroundColor ( gui . config . colors . background ) ;
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 . setTextSize ( 16 ) ;
gui . key _coordinate _navigation . _global _text . setPadding ( dp * 5 , dp * 5 , dp * 5 , dp * 5 ) ;
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 ) ;
gui . key _coordinate _navigation . _global _text . getLayoutParams ( ) . setMargins ( dp * 5 , dp * 5 , dp * 5 , dp * 5 ) ;
@@ -1676,12 +1705,12 @@ gui = {
gui . player _panel . _global _base . setLayoutParams ( new android . widget . LinearLayout . LayoutParams ( - 2 , - 2 ) ) ;
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 . 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 . 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 = new android . widget . TextView ( ctx ) ;
gui . player _panel . _global _text . setId ( 12 ) ;
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 . 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 . setTextSize ( 14 ) ;
gui . player _panel . _global _text . setText ( "解析中..." ) ;
gui . player _panel . _global _text . setText ( "解析中..." ) ;
gui . player _panel . _global _text . setSingleLine ( true ) ;
gui . player _panel . _global _text . setSingleLine ( true ) ;
@@ -1718,7 +1747,7 @@ gui = {
s . close . setBackgroundDrawable ( gui . utils . ripple _drawable ( s . close . getMeasuredWidth ( ) , s . close . getMeasuredHeight ( ) , "rect" ) ) ;
s . close . setBackgroundDrawable ( gui . utils . ripple _drawable ( s . close . getMeasuredWidth ( ) , s . close . getMeasuredHeight ( ) , "rect" ) ) ;
s . close . setText ( "× " ) ;
s . close . setText ( "× " ) ;
s . close . setTextSize ( 15 ) ;
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 ( {
s . close . setOnClickListener ( new android . view . View . OnClickListener ( {
onClick : function ( ) {
onClick : function ( ) {
if ( gui . player _panel . isShowing ) {
if ( gui . player _panel . isShowing ) {
@@ -1757,7 +1786,7 @@ gui = {
gui . player _panel . _global _status . getLayoutParams ( ) . addRule ( android . widget . RelativeLayout . ALIGN _PARENT _TOP ) ;
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 . 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 . 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 . setTextSize ( 12 ) ;
//gui.player_panel._global_status.setPadding(dp * 5, dp * 5, dp * 5, dp * 5);
//gui.player_panel._global_status.setPadding(dp * 5, dp * 5, dp * 5, dp * 5);
s . control _panel . addView ( gui . player _panel . _global _status ) ;
s . control _panel . addView ( gui . player _panel . _global _status ) ;
@@ -1768,7 +1797,7 @@ gui = {
gui . player _panel . _global _cnote . getLayoutParams ( ) . addRule ( android . widget . RelativeLayout . BELOW , 14 ) ;
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 . 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 . 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 . setTextSize ( 12 ) ;
//gui.player_panel._global_cnote.setPadding(dp * 5, dp * 5, dp * 5, dp * 5);
//gui.player_panel._global_cnote.setPadding(dp * 5, dp * 5, dp * 5, dp * 5);
s . control _panel . addView ( gui . player _panel . _global _cnote ) ;
s . control _panel . addView ( gui . player _panel . _global _cnote ) ;
@@ -2028,9 +2057,10 @@ gui.dialogs.showProgressDialog(function(o) {
o . setText ( msg ) ;
o . setText ( msg ) ;
}
}
} ) ;
} ) ;
config . updateBitmapTheme ( ) ;
gui . addViewMaker ( "sheetInfo" , function ( item ) {
gui . addViewMaker ( "sheetInfo" , function ( item ) {
var scr = new android . widget . ScrollView ( ctx ) ;
var scr = new android . widget . ScrollView ( ctx ) ;
scr . setBackgroundColor ( gui . config . colors . background ) ;
scr . setBackgroundColor ( gui . config . colors [ config . values . theme ] .background ) ;
var layout = new android . widget . LinearLayout ( ctx ) ;
var layout = new android . widget . LinearLayout ( ctx ) ;
layout . setLayoutParams ( new android . widget . FrameLayout . LayoutParams ( - 2 , - 2 ) ) ;
layout . setLayoutParams ( new android . widget . FrameLayout . LayoutParams ( - 2 , - 2 ) ) ;
layout . setOrientation ( android . widget . LinearLayout . VERTICAL ) ;
layout . setOrientation ( android . widget . LinearLayout . VERTICAL ) ;
@@ -2040,7 +2070,7 @@ gui.dialogs.showProgressDialog(function(o) {
title . setLayoutParams ( new android . widget . LinearLayout . LayoutParams ( - 2 , - 2 ) ) ;
title . setLayoutParams ( new android . widget . LinearLayout . LayoutParams ( - 2 , - 2 ) ) ;
title . setPadding ( 0 , 0 , 0 , 10 * dp ) ;
title . setPadding ( 0 , 0 , 0 , 10 * dp ) ;
title . setGravity ( android . view . Gravity . LEFT | android . view . Gravity . CENTER ) ;
title . setGravity ( android . view . Gravity . LEFT | android . view . Gravity . CENTER ) ;
title . setTextColor ( gui . config . colors . text ) ;
title . setTextColor ( gui . config . colors [ config . values . theme ] .text ) ;
title . setTextSize ( 20 ) ;
title . setTextSize ( 20 ) ;
title . getLayoutParams ( ) . setMargins ( 0 , 0 , 0 , 7.5 * dp ) ;
title . getLayoutParams ( ) . setMargins ( 0 , 0 , 0 , 7.5 * dp ) ;
layout . addView ( title ) ;
layout . addView ( title ) ;
@@ -2061,7 +2091,7 @@ gui.dialogs.showProgressDialog(function(o) {
authorText . getLayoutParams ( ) . addRule ( android . widget . RelativeLayout . RIGHT _OF , 10 ) ;
authorText . getLayoutParams ( ) . addRule ( android . widget . RelativeLayout . RIGHT _OF , 10 ) ;
authorText . setPadding ( 0 , 0 , 0 , 0 ) ;
authorText . setPadding ( 0 , 0 , 0 , 0 ) ;
authorText . setGravity ( android . view . Gravity . LEFT | android . view . Gravity . CENTER ) ;
authorText . setGravity ( android . view . Gravity . LEFT | android . view . Gravity . CENTER ) ;
authorText . setTextColor ( gui . config . colors . text ) ;
authorText . setTextColor ( gui . config . colors [ config . values . theme ] .text ) ;
authorText . setTextSize ( 16 ) ;
authorText . setTextSize ( 16 ) ;
authorText . getLayoutParams ( ) . setMargins ( dp * 7.5 , 0 , 0 , dp * 5 ) ;
authorText . getLayoutParams ( ) . setMargins ( dp * 7.5 , 0 , 0 , dp * 5 ) ;
var noteImg = new android . widget . ImageView ( ctx ) ;
var noteImg = new android . widget . ImageView ( ctx ) ;
@@ -2080,7 +2110,7 @@ gui.dialogs.showProgressDialog(function(o) {
noteText . getLayoutParams ( ) . addRule ( android . widget . RelativeLayout . BELOW , 11 ) ;
noteText . getLayoutParams ( ) . addRule ( android . widget . RelativeLayout . BELOW , 11 ) ;
noteText . setPadding ( 0 , 0 , 0 , 0 ) ;
noteText . setPadding ( 0 , 0 , 0 , 0 ) ;
noteText . setGravity ( android . view . Gravity . LEFT | android . view . Gravity . CENTER ) ;
noteText . setGravity ( android . view . Gravity . LEFT | android . view . Gravity . CENTER ) ;
noteText . setTextColor ( gui . config . colors . text ) ;
noteText . setTextColor ( gui . config . colors [ config . values . theme ] .text ) ;
noteText . setTextSize ( 16 ) ;
noteText . setTextSize ( 16 ) ;
noteText . getLayoutParams ( ) . setMargins ( dp * 7.5 , dp * 5 , 0 , dp * 5 ) ;
noteText . getLayoutParams ( ) . setMargins ( dp * 7.5 , dp * 5 , 0 , dp * 5 ) ;
var pitchImg = new android . widget . ImageView ( ctx ) ;
var pitchImg = new android . widget . ImageView ( ctx ) ;
@@ -2117,7 +2147,7 @@ gui.dialogs.showProgressDialog(function(o) {
pitchText . getLayoutParams ( ) . addRule ( android . widget . RelativeLayout . BELOW , 13 ) ;
pitchText . getLayoutParams ( ) . addRule ( android . widget . RelativeLayout . BELOW , 13 ) ;
pitchText . setPadding ( 0 , 0 , 0 , 0 ) ;
pitchText . setPadding ( 0 , 0 , 0 , 0 ) ;
pitchText . setGravity ( android . view . Gravity . LEFT | android . view . Gravity . CENTER ) ;
pitchText . setGravity ( android . view . Gravity . LEFT | android . view . Gravity . CENTER ) ;
pitchText . setTextColor ( gui . config . colors . text ) ;
pitchText . setTextColor ( gui . config . colors [ config . values . theme ] .text ) ;
pitchText . setTextSize ( 16 ) ;
pitchText . setTextSize ( 16 ) ;
pitchText . getLayoutParams ( ) . setMargins ( dp * 7.5 , dp * 5 , 0 , dp * 5 ) ;
pitchText . getLayoutParams ( ) . setMargins ( dp * 7.5 , dp * 5 , 0 , dp * 5 ) ;
infoLayout . addView ( authorImg ) ;
infoLayout . addView ( authorImg ) ;
@@ -2152,7 +2182,7 @@ gui.dialogs.showProgressDialog(function(o) {
timeText . getLayoutParams ( ) . addRule ( android . widget . RelativeLayout . BELOW , 15 ) ;
timeText . getLayoutParams ( ) . addRule ( android . widget . RelativeLayout . BELOW , 15 ) ;
timeText . setPadding ( 0 , 0 , 0 , 0 ) ;
timeText . setPadding ( 0 , 0 , 0 , 0 ) ;
timeText . setGravity ( android . view . Gravity . LEFT | android . view . Gravity . CENTER ) ;
timeText . setGravity ( android . view . Gravity . LEFT | android . view . Gravity . CENTER ) ;
timeText . setTextColor ( gui . config . colors . text ) ;
timeText . setTextColor ( gui . config . colors [ config . values . theme ] .text ) ;
timeText . setTextSize ( 16 ) ;
timeText . setTextSize ( 16 ) ;
timeText . getLayoutParams ( ) . setMargins ( dp * 7.5 , dp * 5 , 0 , 0 ) ;
timeText . getLayoutParams ( ) . setMargins ( dp * 7.5 , dp * 5 , 0 , 0 ) ;
infoLayout . addView ( timeImg ) ;
infoLayout . addView ( timeImg ) ;
@@ -2165,7 +2195,7 @@ gui.dialogs.showProgressDialog(function(o) {
sugPrompt . setText ( "建议弹奏地点:" ) ;
sugPrompt . setText ( "建议弹奏地点:" ) ;
sugPrompt . setLayoutParams ( new android . widget . LinearLayout . LayoutParams ( - 2 , - 2 ) ) ;
sugPrompt . setLayoutParams ( new android . widget . LinearLayout . LayoutParams ( - 2 , - 2 ) ) ;
sugPrompt . setGravity ( android . view . Gravity . LEFT | android . view . Gravity . CENTER ) ;
sugPrompt . setGravity ( android . view . Gravity . LEFT | android . view . Gravity . CENTER ) ;
sugPrompt . setTextColor ( gui . config . colors . text ) ;
sugPrompt . setTextColor ( gui . config . colors [ config . values . theme ] .text ) ;
sugPrompt . setTextSize ( 16 ) ;
sugPrompt . setTextSize ( 16 ) ;
sugPrompt . getLayoutParams ( ) . setMargins ( 0 , 5 * dp , 0 , 5 * dp ) ;
sugPrompt . getLayoutParams ( ) . setMargins ( 0 , 5 * dp , 0 , 5 * dp ) ;
layout . addView ( sugPrompt ) ;
layout . addView ( sugPrompt ) ;
@@ -2180,7 +2210,7 @@ gui.dialogs.showProgressDialog(function(o) {
} ( ) ) ) ;
} ( ) ) ) ;
sug . setLayoutParams ( new android . widget . LinearLayout . LayoutParams ( - 2 , - 2 ) ) ;
sug . setLayoutParams ( new android . widget . LinearLayout . LayoutParams ( - 2 , - 2 ) ) ;
sug . setGravity ( android . view . Gravity . LEFT | android . view . Gravity . CENTER ) ;
sug . setGravity ( android . view . Gravity . LEFT | android . view . Gravity . CENTER ) ;
sug . setTextColor ( gui . config . colors . sec _text ) ;
sug . setTextColor ( gui . config . colors [ config . values . theme ] .sec _text ) ;
sug . setTextSize ( 15 ) ;
sug . setTextSize ( 15 ) ;
sug . getLayoutParams ( ) . setMargins ( 7 * dp , 5 * dp , 0 , 0 ) ;
sug . getLayoutParams ( ) . setMargins ( 7 * dp , 5 * dp , 0 , 0 ) ;
layout . addView ( sug ) ;
layout . addView ( sug ) ;
@@ -2191,9 +2221,9 @@ gui.dialogs.showProgressDialog(function(o) {
index : 0 ,
index : 0 ,
title : "本地乐谱" ,
title : "本地乐谱" ,
navigation _title : "本地乐谱" ,
navigation _title : "本地乐谱" ,
navigation _icon : config . bitmaps . local,
navigation _icon : " local" ,
func : [ {
func : [ {
icon : android . graphics . Bitmap . createBitmap ( config . bitmaps . refresh) ,
icon : " refresh" ,
onClick : function ( s , selfContent ) {
onClick : function ( s , selfContent ) {
selfContent . getSheetList ( s , true ) ;
selfContent . getSheetList ( s , true ) ;
} ,
} ,
@@ -2226,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 . CENTER _VERTICAL ) ;
element . v _upload . getLayoutParams ( ) . addRule ( android . widget . RelativeLayout . RIGHT _OF , 10 ) ;
element . v _upload . getLayoutParams ( ) . addRule ( android . widget . RelativeLayout . RIGHT _OF , 10 ) ;
element . v _upload . setTextSize ( 13 ) ;
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 _upload . setText ( element . title ) ;
element . v _relative . addView ( element . v _upload ) ;
element . v _relative . addView ( element . v _upload ) ;
return element . v _relative ;
return element . v _relative ;
@@ -2240,7 +2270,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 . ALIGN _PARENT _LEFT ) ;
if ( element . failed ) element . v _title . getLayoutParams ( ) . addRule ( android . widget . RelativeLayout . CENTER _VERTICAL ) ;
if ( element . failed ) element . v _title . getLayoutParams ( ) . addRule ( android . widget . RelativeLayout . CENTER _VERTICAL ) ;
element . v _title . setTextSize ( 16 ) ;
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 _title . setText ( element . failed ? android . text . Html . fromHtml ( "<s>" + element . fileName + "</s>" ) : element . name ) ;
element . v _relative . addView ( element . v _title ) ;
element . v _relative . addView ( element . v _title ) ;
@@ -2252,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 . BELOW , 10 ) ;
element . v _author . getLayoutParams ( ) . addRule ( android . widget . RelativeLayout . ALIGN _PARENT _LEFT ) ;
element . v _author . getLayoutParams ( ) . addRule ( android . widget . RelativeLayout . ALIGN _PARENT _LEFT ) ;
element . v _author . setTextSize ( 14 ) ;
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 _author . setText ( "键数: " + element . songNotes . length + " - BPM: " + element . bpm ) ;
element . v _relative . addView ( element . v _author ) ;
element . v _relative . addView ( element . v _author ) ;
@@ -2449,7 +2479,7 @@ gui.dialogs.showProgressDialog(function(o) {
s . ns0 _progress . setPadding ( 0 , 0 , 0 , 0 ) ;
s . ns0 _progress . setPadding ( 0 , 0 , 0 , 0 ) ;
s . ns0 _progress . getLayoutParams ( ) . setMargins ( 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 . 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 . setIndeterminate ( true ) ;
s . ns0 _progress . setAlpha ( 0 ) ;
s . ns0 _progress . setAlpha ( 0 ) ;
@@ -2519,9 +2549,9 @@ gui.dialogs.showProgressDialog(function(o) {
index : 1 ,
index : 1 ,
title : "共享乐谱" ,
title : "共享乐谱" ,
navigation _title : "共享乐谱" ,
navigation _title : "共享乐谱" ,
navigation _icon : config . bitmaps . online,
navigation _icon : " online" ,
func : [ {
func : [ {
icon : android . graphics . Bitmap . createBitmap ( config . bitmaps . refresh) ,
icon : " refresh" ,
onClick : function ( s , selfContent ) {
onClick : function ( s , selfContent ) {
if ( s . ns1 _isShowingSearchEditTextView ) selfContent . removeSearchEditTextView ( s , selfContent ) ;
if ( s . ns1 _isShowingSearchEditTextView ) selfContent . removeSearchEditTextView ( s , selfContent ) ;
selfContent . getOnlineSheetList ( s , true ) ;
selfContent . getOnlineSheetList ( s , true ) ;
@@ -2532,7 +2562,7 @@ gui.dialogs.showProgressDialog(function(o) {
toast("Click filter")
toast("Click filter")
},
},
},*/ {
},*/ {
icon : android . graphics . Bitmap . createBitmap ( config . bitmaps . search) ,
icon : " search" ,
onClick : function ( s , selfContent ) {
onClick : function ( s , selfContent ) {
if ( s . ns1 _isShowingSearchEditTextView ) {
if ( s . ns1 _isShowingSearchEditTextView ) {
selfContent . removeSearchEditTextView ( s , selfContent ) ;
selfContent . removeSearchEditTextView ( s , selfContent ) ;
@@ -2575,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 . CENTER _VERTICAL ) ;
element . v _upload . getLayoutParams ( ) . addRule ( android . widget . RelativeLayout . RIGHT _OF , 10 ) ;
element . v _upload . getLayoutParams ( ) . addRule ( android . widget . RelativeLayout . RIGHT _OF , 10 ) ;
element . v _upload . setTextSize ( 13 ) ;
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 _upload . setText ( element . title ) ;
element . v _relative . addView ( element . v _upload ) ;
element . v _relative . addView ( element . v _upload ) ;
} ; break ;
} ; break ;
@@ -2591,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 ( ) . setMargins ( dp * 15 , dp * 15 , dp * 15 , dp * 1 ) ;
element . v _title . getLayoutParams ( ) . addRule ( android . widget . RelativeLayout . ALIGN _PARENT _LEFT ) ;
element . v _title . getLayoutParams ( ) . addRule ( android . widget . RelativeLayout . ALIGN _PARENT _LEFT ) ;
element . v _title . setTextSize ( 16 ) ;
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 _title . setText ( element . name ) ;
element . v _relative . addView ( element . v _title ) ;
element . v _relative . addView ( element . v _title ) ;
@@ -2602,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 . BELOW , 10 ) ;
element . v _info . getLayoutParams ( ) . addRule ( android . widget . RelativeLayout . ALIGN _PARENT _LEFT ) ;
element . v _info . getLayoutParams ( ) . addRule ( android . widget . RelativeLayout . ALIGN _PARENT _LEFT ) ;
element . v _info . setTextSize ( 15 ) ;
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 _info . setText ( element . author ) ;
element . v _relative . addView ( element . v _info ) ;
element . v _relative . addView ( element . v _info ) ;
@@ -2613,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 . BELOW , 11 ) ;
element . v _desc . getLayoutParams ( ) . addRule ( android . widget . RelativeLayout . ALIGN _PARENT _LEFT ) ;
element . v _desc . getLayoutParams ( ) . addRule ( android . widget . RelativeLayout . ALIGN _PARENT _LEFT ) ;
element . v _desc . setTextSize ( 13 ) ;
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 _desc . setText ( android . text . Html . fromHtml ( element . desc . replace ( new RegExp ( "\x0a" , "gi" ) , "<br>" ) ) ) ;
element . v _relative . addView ( element . v _desc ) ;
element . v _relative . addView ( element . v _desc ) ;
@@ -2698,7 +2728,7 @@ gui.dialogs.showProgressDialog(function(o) {
element . v _status . getLayoutParams ( ) . addRule ( android . widget . RelativeLayout . ALIGN _PARENT _LEFT ) ;
element . v _status . getLayoutParams ( ) . addRule ( android . widget . RelativeLayout . ALIGN _PARENT _LEFT ) ;
element . v _status . setTextSize ( 13 ) ;
element . v _status . setTextSize ( 13 ) ;
element . v _status . setAlpha ( 0 ) ;
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 = new android . widget . ProgressBar ( ctx , null , android . R . attr . progressBarStyleHorizontal ) ;
element . v _progress . setLayoutParams ( new android . widget . RelativeLayout . LayoutParams ( - 1 , dp * 15 ) ) ;
element . v _progress . setLayoutParams ( new android . widget . RelativeLayout . LayoutParams ( - 1 , dp * 15 ) ) ;
@@ -2706,7 +2736,7 @@ gui.dialogs.showProgressDialog(function(o) {
element . v _progress . getLayoutParams ( ) . addRule ( android . widget . RelativeLayout . BELOW , 13 ) ;
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 ( ) . setMargins ( dp * 15 , 0 , dp * 15 , dp * 5 ) ;
element . v _progress . getLayoutParams ( ) . addRule ( android . widget . RelativeLayout . ALIGN _PARENT _BOTTOM ) ;
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 . setIndeterminate ( false ) ;
element . v _progress . setAlpha ( 0 ) ;
element . v _progress . setAlpha ( 0 ) ;
} ; break ;
} ; break ;
@@ -2787,7 +2817,7 @@ gui.dialogs.showProgressDialog(function(o) {
s . ns1 _progress . setPadding ( 0 , 0 , 0 , 0 ) ;
s . ns1 _progress . setPadding ( 0 , 0 , 0 , 0 ) ;
s . ns1 _progress . getLayoutParams ( ) . setMargins ( 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 . 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 . setIndeterminate ( true ) ;
s . ns1 _progress . setAlpha ( 0 ) ;
s . ns1 _progress . setAlpha ( 0 ) ;
@@ -2808,8 +2838,8 @@ gui.dialogs.showProgressDialog(function(o) {
s . ns1 _searchEditText . setPadding ( dp * 5 , dp * 5 , dp * 5 , dp * 5 ) ;
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 . getLayoutParams ( ) . addRule ( android . widget . RelativeLayout . ALIGN _PARENT _LEFT ) ;
s . ns1 _searchEditText . setTextSize ( 15 ) ;
s . ns1 _searchEditText . setTextSize ( 15 ) ;
s . ns1 _searchEditText . setTextColor ( gui . config . colors . text ) ;
s . ns1 _searchEditText . setTextColor ( gui . config . colors [ config . values . theme ] .text ) ;
s . ns1 _searchEditText . setHintTextColor ( gui . config . colors . sec _text ) ;
s . ns1 _searchEditText . setHintTextColor ( gui . config . colors [ config . values . theme ] .sec _text ) ;
s . ns1 _searchEditText . setHint ( "按回车开始搜索" ) ;
s . ns1 _searchEditText . setHint ( "按回车开始搜索" ) ;
s . ns1 _searchEditText . setAlpha ( 0 ) ;
s . ns1 _searchEditText . setAlpha ( 0 ) ;
s . ns1 _searchEditText . setOnClickListener ( new android . view . View . OnClickListener ( {
s . ns1 _searchEditText . setOnClickListener ( new android . view . View . OnClickListener ( {
@@ -2924,7 +2954,7 @@ gui.dialogs.showProgressDialog(function(o) {
index : 2 ,
index : 2 ,
title : "设置" ,
title : "设置" ,
navigation _title : "设置" ,
navigation _title : "设置" ,
navigation _icon : config . bitmaps . settings,
navigation _icon : " settings" ,
view : function ( s ) {
view : function ( s ) {
s . ns2 _listView = new android . widget . ListView ( ctx ) ;
s . ns2 _listView = new android . widget . ListView ( ctx ) ;
s . ns2 _listView . setLayoutParams ( new android . widget . LinearLayout . LayoutParams ( - 1 , s . _content _height ) ) ;
s . ns2 _listView . setLayoutParams ( new android . widget . LinearLayout . LayoutParams ( - 1 , s . _content _height ) ) ;
@@ -2972,6 +3002,24 @@ gui.dialogs.showProgressDialog(function(o) {
onClick : function ( checked ) {
onClick : function ( checked ) {
config . values . tipOnAndroidR = config . save ( "tip_storage_on_android_r" , 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" ,
type : "tag" ,
name : "关于" ,
name : "关于" ,
@@ -3001,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" ,
type : "default" ,
name : "结束脚本运行" ,
name : "结束脚本运行" ,
@@ -3030,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 ( ) . setMargins ( dp * 5 , dp * 5 , dp * 5 , dp * 5 ) ;
element . v _title . getLayoutParams ( ) . addRule ( android . widget . RelativeLayout . ALIGN _PARENT _LEFT ) ;
element . v _title . getLayoutParams ( ) . addRule ( android . widget . RelativeLayout . ALIGN _PARENT _LEFT ) ;
element . v _title . setTextSize ( 12 ) ;
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 _title . setText ( element . name ) ;
element . v _relative . addView ( element . v _title ) ;
element . v _relative . addView ( element . v _title ) ;
break ;
break ;
@@ -3041,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 ( ) . setMargins ( dp * 10 , dp * 10 , dp * 10 , dp * 10 ) ;
element . v _title . getLayoutParams ( ) . addRule ( android . widget . RelativeLayout . ALIGN _PARENT _LEFT ) ;
element . v _title . getLayoutParams ( ) . addRule ( android . widget . RelativeLayout . ALIGN _PARENT _LEFT ) ;
element . v _title . setTextSize ( 14 ) ;
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 _title . setText ( element . name ) ;
element . v _relative . addView ( element . v _title ) ;
element . v _relative . addView ( element . v _title ) ;
break ;
break ;
@@ -3053,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 . ALIGN _PARENT _LEFT ) ;
element . v _title . getLayoutParams ( ) . addRule ( android . widget . RelativeLayout . CENTER _VERTICAL ) ;
element . v _title . getLayoutParams ( ) . addRule ( android . widget . RelativeLayout . CENTER _VERTICAL ) ;
element . v _title . setTextSize ( 14 ) ;
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 _title . setText ( element . name ) ;
element . v _relative . addView ( element . v _title ) ;
element . v _relative . addView ( element . v _title ) ;