源码在此:
require "import"
import "android.widget.*"
import "android.net.Uri"
import "android.content.Intent"
QID = "2148501244"
QQ_group = "816035383"
email = "wuqishao@outlook.com"
layout_1 = {LinearLayout,
background = "#000000",
orientation = 1,
layout_width = "100%w",
layout_height = "100%h",
{TextView,
text = "屏 幕 搜 索",
ContentDescription = "屏幕搜索",
textSize = "20sp",
textColor = "#FFFFFF",
background = "#191970",
gravity = 17,
layout_width = -1,
layout_height = "6.6%h",
},
{EditText,
id = "SearchBox",
hint = "请输入搜索规则,只能输入一个查找对象,(必填)",
singleLine = true,
textSize = "19sp",
textColor = "#FFFFFF",
background = "#292929",
gravity = 17,
layout_width = -1,
layout_height = -2,
},
{EditText,
id = "Number",
hint = "最多翻多少页,不翻页可留空",
InputType = "number",
singleLine = true,
textSize = "19sp",
textColor = "#FFFFFF",
background = "#292929",
gravity = 17,
layout_width = -1,
layout_height = -2,
},
{Button,
id = "SearchDown",
text = "查找↓",
ContentDescription = "向下查找",
textSize = "19sp",
textColor = "#EDEDED",
background = "#000000",
gravity = 17,
layout_width = -1,
layout_height = "6%h",
Defaule = True,
onClick = "search_down",
},
{Button,
id = "SearchUp",
text = "查找↑",
ContentDescription = "向上查找",
textSize = "19sp",
textColor = "#EDEDED",
background = "#000000",
gravity = 17,
layout_width = -1,
layout_height = "6%h",
onClick = "search_up",
},
{Button,
id = "Expression",
text = "查找表情",
ContentDescription = "查找表情",
textSize = "19sp",
textColor = "#EDEDED",
background = "#000000",
gravity = 17,
layout_width = -1,
layout_height = "6%h",
onClick = "expression",
},
{TextView,
text = "表情查找仅支持QQ和微信",
textSize = "16sp",
textColor = "#808080",
background = "#000000",
gravity = 17,
layout_width = -1,
layout_height = -2,
},
{Button,
id = "Shut",
text = "关 闭",
ContentDescription = "关闭",
textSize = "19sp",
textColor = "#EDEDED",
background = "#000000",
gravity = 17,
layout_width = -1,
layout_height = "6%h",
Cancel = True,
onClick = "shut"
},
{TextView,
ContentDescription = "华丽分割线",
background = "#EDEDED",
layout_width = -1,
layout_height = "0.11%h",
},
{Button,
id = "Help",
text = "帮 助",
ContentDescription = "帮助",
textSize = "18sp",
textColor = "#EDEDED",
background = "#000000",
gravity = 17,
layout_width = -1,
layout_height = "5%h",
onClick = "help",
},}
layout_2 = {LinearLayout,
background = "#000000",
orientation = 1,
layout_width = "100%w",
layout_height = "100%h",
{TextView,
text = "帮 助",
ContentDescription = "帮助",
textSize = "18sp",
textColor = "#FFFFFF",
background = "#191970",
gravity = 17,
layout_width = -1,
layout_height = "6%h",
},
{TextView,
text = " 1.在第一个编辑框输入想要查找的对象名称,第二个编辑框输入最多翻多少页。\n 2.搜索内容前后加星号表示查找的对象前后可以包含若干任意字符。\n 3.前面家小于号则仅聚焦到该焦点,不执行点击操作。\n 4.不要在搜索内容的后面加大于号和美元符号相关的内容,否则会很恐怖的哦。\n 5.查找表情仅支持QQ和微信,前后不能加任何标点符号,除非那个表情上面有的,不然也会很恐怖的哦。",
textSize = "17sp",
textColor = "#EDEDED",
background = "#000000",
gravity = 3,
layout_width = -1,
layout_height = -2,
},
{TextView,
text = "作者:Qishao;等级:菜鸟",
textSize = "17sp",
textColor = "#EDEDED",
background = "#000000",
gravity = 3,
layout_width = -1,
layout_height = -2,
},
{TextView,
ContentDescription = "华丽分割线",
background = "#EDEDED",
layout_width = -1,
layout_height = "0.12%h",
},
{ListView,
id = "list1",
items = {
"联系QQ:"..QID,
"邮箱:"..email,
"QQ群:"..QQ_group,},
background = "#000000",
layout_width = -1,
layout_height = -1,
},
{Button,
id = "Understand",
text = "朕知道了",
ContentDescription = "朕知道了",
textSize = "19sp",
textColor = "#EDEDED",
background = "#000000",
gravity = 17,
layout_width = -1,
layout_height = "6%h",
Cancel = True,
onClick = "understand"
},}
DLG_1 = LuaDialog()
.setView(loadlayout(layout_1))
.show()
function alert()
service.speak("你还没有输入内容哦")
end
function disappearance_1()
DLG_1.hide()
end
function prompt()
service.speak("拼命寻找中")
end
function speak()
Toast.makeText(service,"找到啦",Toast.LENGTH_SHORT ).show()
end
function search_down()
if SearchBox.Text == "" then
alert()
else
disappearance_1()
prompt()
service.click({{"%延时$500","%下个焦点$100",""..SearchBox.Text.."|%向下翻页>"..Number.Text.."$200","%speak"}})
end
end
function search_up()
if SearchBox.Text == "" then
alert()
else
disappearance_1()
prompt()
service.click({{"%延时$500","%下个焦点$100",""..SearchBox.Text.."|%向上翻页>"..Number.Text.."$200","%speak"}})
end
end
function expression()
if SearchBox.Text == "" then
alert()
else
disappearance_1()
prompt()
service.click({{"%延时$500","表情$100","[0.5, 0.7, 0.5, 0.9, 1]<2$100","<最近使用|%下个焦点>9$300","<*"..SearchBox.Text.."*|%向下翻页>"..Number.Text.."$200","%[点击]$500","%开头","%返回$1","%speak"}})
end
end
function shut()
disappearance_1()
service.speak("关闭啦")
end
function help()
DLG_2 = LuaDialog()
.setView(loadlayout(layout_2))
.show()
function disappearance_2()
DLG_2.hide()
end
function understand()
disappearance_2()
service.speak("好嘞")
end
list1.onItemClick = function(l,v,p,i)
if i == 1 then
disappearance_1()
disappearance_2()
this.startActivity(Intent(Intent.ACTION_VIEW, Uri.parse("mqqwpa://im/chat?chat_type=wpa&uin="..QID)))
Toast.makeText(service,"嗨~有问题你可以给我留言哦",Toast.LENGTH_SHORT ).show()
elseif i == 2 then
service.copy(email)
service.speak("邮箱地址已经复制到剪切板啦")
elseif i == 3 then
disappearance_1()
disappearance_2()
this.startActivity(Intent(Intent.ACTION_VIEW, Uri.parse("mqqapi://card/show_pslcard?src_type=internal&version=1&uin="..QQ_group.."&card_type=group&source=qrcode")))
Toast.makeText(service,"非常欢迎你加入我们这个大家庭和我们一起玩哦",Toast.LENGTH_SHORT ).show()
end
end
end
来自解说社区客户端 |