draw.text('‍💫 『音乐一体修改器』 作者: 清烟 代理: 永恒 南辞‍ 💫', 150,150)draw.setColor('#D32F2F') draw.setColor('#D32F2F') draw.text('‍作者QQ群『595081248』', 200,850)draw.setColor('#D32F2F') draw.setColor('#D32F2F') draw.text('提供QQ群『484886153』', 250,900)draw.setColor('#D32F2F') draw.setColor('#D32F2F') local function interruptThread(thread) if thread then pcall(function() thread:interrupt() end) end end function A1() gg.alert('开启成功') gg.sleep(1000) end function A2() gg.alert('开启成功') gg.sleep(1000) end function A3() gg.alert('开启成功') gg.sleep(1000) end function B1() while true do gg.toast('开启成功') gg.sleep(1000) end end function B2() while true do gg.toast('开启成功') gg.sleep(1000) end end function B3() while true do gg.toast('开启成功') gg.sleep(1000) end end function C1() gg.alert('开启成功') gg.sleep(1000) end function C2() gg.alert('开启成功') gg.sleep(1000) end function C3() gg.clearResults() gg.searchNumber(100) gg.alert(string.format('搜索到%s个结果', gg.getResultsCount())) end -- 获取线程回调赋值给 onClick 可以避免UI堵塞问题 local function getASyncThreadCallbak(func) -- 异步线程回调 return function() luajava.startThread(function() return pcall(func) end) end end -- 应用在101行 local task local function getSyncThreadCallbak(func) -- 同步线程回调, 涉及gg类库的回调只能使用这种,否则可能不稳定 return function() if task then gg.toast('正在运行其它任务,再稍后!') return end luajava.startThread(function() task = true pcall(func) task = nil end) end end local function callSyncThreadCallbak(func) return getSyncThreadCallbak(func)() end local floatingWindowManager = require('floatingWindowManager') floatingWindowManager:init() floatingWindowManager:newWindow(('清烟一体音乐修改器'):format(floatingWindowManager.version), { onCreate = function(floatingWindow) floatingWindow:addlayout({ ScrollView, layout_margin = '10dp', layout_width = 'match_parent', layout_height = 'match_parent', { LinearLayout, background="https://cccimg.com/view.php/96922604063161a55e5446c5b6d18a89.jpg", layout_width = 'match_parent', layout_height = 'match_parent', orientation = 'vertical', padding = '10dp', { Button, background = floatingWindowManager:getStateListDrawable(), layout_width = 'match_parent', layout_margin = '5dp', text = '不要点', textSize = '16sp', onClick = function() floatingWindowManager:start('不要点页面') end }, { Button, background = floatingWindowManager:getStateListDrawable(), layout_width = 'match_parent', layout_margin = '5dp', text = '音乐页面', textSize = '16sp', onClick = function() floatingWindowManager:start('清烟音乐页面') end } } }) end, onDestroy = function() -- gg.alert('欢迎下次使用!') end }) local floatingWindowManager = require('floatingWindowManager') floatingWindowManager:init() floatingWindowManager:newWindow('清烟音乐页面', { onCreate = function(floatingWindow) floatingWindow:addlayout({ ScrollView, layout_width = 'match_parent', layout_height = 'match_parent', { LinearLayout, background="http://vip.wskig.top/view.php/1643db555aef57a4a4d89f6100ba5c43.jpg", layout_width = 'match_parent', layout_height = 'match_parent', orientation = 'vertical', padding = '10dp', { Switch, layout_width = 'match_parent', text = '我一个人煮咖啡', onCheckedChange = function(CompoundButton, state) if state then h1() else string.toMusic("已关闭") gg.alert('已关闭') end end }; { Switch, layout_width = 'match_parent', text = '爱如火', onCheckedChange = function(CompoundButton, state) if state then h2() else string.toMusic("已关闭") gg.alert('已关闭') end end }; { Switch, layout_width = 'match_parent', text = '精卫', onCheckedChange = function(CompoundButton, state) if state then h3() else string.toMusic("已关闭") gg.alert('已关闭') end end }; { Switch, layout_width = 'match_parent', text = '爱人错过', onCheckedChange = function(CompoundButton, state) if state then h4() else string.toMusic("已关闭") gg.alert('已关闭') end end }; { Switch, layout_width = 'match_parent', text = '雾里', onCheckedChange = function(CompoundButton, state) if state then h5() else string.toMusic("已关闭") gg.alert('已关闭') end end }; { Switch, layout_width = 'match_parent', text = '夜巴黎', onCheckedChange = function(CompoundButton, state) if state then h6() else string.toMusic("已关闭") gg.alert('已关闭') end end }; { Switch, layout_width = 'match_parent', text = '🐓出没', onCheckedChange = function(CompoundButton, state) if state then h7() else string.toMusic("已关闭") gg.alert('已关闭') end end }; { Switch, layout_width = 'match_parent', text = '无名[没]', onCheckedChange = function(CompoundButton, state) if state then h8() else string.toMusic("已关闭") gg.alert('已关闭') end end }; } }) end }) function h1() gg.playMusic("http://music.163.com/song/media/outer/url?id=2023954033&uct2.mp3") end function h2() gg.playMusic("http://music.163.com/song/media/outer/url?id=1999552137&uct2.mp3") end function h3() gg.playMusic("http://music.163.com/song/media/outer/url?id=1951069525&uct2.mp3") end function h4() gg.playMusic("http://music.163.com/song/media/outer/url?id=1368754688&uct2.mp3") end function h5() gg.playMusic("http://music.163.com/song/media/outer/url?id=1815085049&uct2.mp3") end function h6() gg.playMusic("http://music.163.com/song/media/outer/url?id=1360748201&uct2.mp3") end function h7() gg.playMusic("http://music.163.com/song/media/outer/url?id=1942433718&uct2.mp3") end function h8() gg.playMusic("http://music.163.com/song/media/outer/url?id=山&uct2.mp3") end floatingWindowManager:newWindow('不要点页面', { onCreate = function(floatingWindow) floatingWindow:addlayout({ ScrollView, layout_width = 'match_parent', layout_height = 'match_parent', { LinearLayout, background="https://cccimg.com/view.php/96922604063161a55e5446c5b6d18a89.jpg", layout_width = 'match_parent', layout_height = 'match_parent', orientation = 'vertical', padding = '10dp', { Switch, layout_width = 'match_parent', text = '你居然打开了', onCheckedChange = function(CompoundButton, state) if state then B3() else gg.alert('开启成功') end end }, { Switch, layout_width = 'match_parent', text = '你打开了千万不要点', onCheckedChange = function(CompoundButton, state) if state then B3() else gg.alert('开启成功') end end } } }) end }) -- 运行悬浮窗 floatingWindowManager:run()