本帖最后由 hoibo 于 2023-3-21 14:24 编辑
require "import"
import "android.widget.*"
import "com.androlua.*"
layout=
{
LinearLayout,
orientation=1,
layout_width=-1,
layout_height=-1,
{
LinearLayout,
orientation=1,
layout_width=-1,
layout_height=-1,
layout_weight=1,
{
EditText,
id="edit",
hint="名称(不输入将对当前焦点进行操作)",
layout_width=-1,
layout_height="10%h",
layout_weight=1,
},
{
EditText,
id="edit2",
hint="次数",
layout_width=-1,
layout_height="10%h",
layout_weight=1,
InputType="number"
},
{
EditText,
text="100",
id="edit3",
hint="时间(以毫秒为单位)",
layout_width=-1,
layout_height="10%h",
layout_weight=1,
InputType="number"
},
},
{
Button,
text="确定",
onClick="qd",
layout_width=-1,
layout_height="10%h",
layout_weight=1,
},
}
local a=service.getText(node)
dlg=LuaDialog()
.setView(loadlayout(layout))
.show()
function qd()
dlg.hide()
if edit.text==""
require "import"
import "android.graphics.Rect"
local p=Rect()
node.getBoundsInScreen(p)
service.copy("!@#复制文字自动执行\n".."["..string.format("%.0f,%.0f",(p.left+(p.right-p.left)/2),(p.top+(p.bottom-p.top)/2)).."]".."<"..edit2.text.."$"..edit3.text)
else
service.copy("!@#复制文字自动执行\n".."*"..edit.text.."*".."<"..edit2.text.."$"..edit3.text)
end
end |