﻿符号=
  {
"\"",",",".","，","。","*","#","%",">","<","--备注，","(",")","￥","$","￥500","$500","/","版本:：Version ",":","【】","【","】","+","&","=","@","“","”","'","？","‘","’","《","》","_","…","[","]","、","[]","|","-","……","——","；","^",[[--接微信电话，打开关闭免提备注，"接听#0","免*#0",]],[[--微信电话取消挂断备注，
"取消#0","挂断#0",]],[[--抢微信红包备注，
{"领取红包@微信","$3"},
{"查看红包@微信","$3"},]],[[--抢QQ红包备注，
{"*点击查看详情"},
{"*点击拆开"},
{"口令*$500","点击输入口令*>50$100","发送"},
{"*点击录制口令$500","*按住录音<3>50$50"},]],[[--电话-接听，打开关闭免提备注，
"接*",
"免提","听筒",
"*扬声器",]],[[--电话挂断备注，
"挂*","拒接",]],[[--增加进度条备注，
if service.check("进度条",node) and service.execute("增加进度",node) then    return true    end]],
    [[--减少进度条备注，
if service.check("进度条",node) and service.execute("减少进度",node) then    return true    end]],[[--提取号码和网址备注，
text=tostring(service.getText(node))
if text:find("%d%d%d%d%d") or text:find("http") then
service.plugin("提取网址和号码",node)
service.plugin("提取号码",node)
service.plugin("提取网址",node)
return true
end]],[[--将焦点移至屏幕上的第一项内容备注，
service.toStart()
return true]],
    [[--将焦点移至屏幕上的最后一项内容备注，
service.toEnd()
return true]],[[--用于在编辑框执行某些功能，备注。
{"&可编辑$5","%剪切板"},]],[[--用于激活编辑框弹出键盘执行某些功能，备注。
{"&编辑框$5","%剪切板"},]],
 [[--当前执行，
return true]],[[--返回上一层执行，
return false]],[[--判断当前是输入法执行默认手势，
if service.check("编辑框",node) then
return false
end]],[[--判断编辑框，
if node.isEditable() then    return false    end]],[[%长按$50]],[[%上个焦点$50]],[[%下个焦点$50]],[[%点击$50]],[[%返回$200]],[[|%向下翻页>10]],[[>50$500]],
[[-- 备份手势-备份当前应用快捷手势 -将下面应用名称改成你所需要备份的程序名称，备注，
按钮列表=
{
{"%程序设置$500","高级设置>50$50","资源管理>50$500","手势管理>50$500",
"QQ|%向下翻页>10",
"备份|%向下翻页>10","%返回<3$500",},
}
service.click(按钮列表)
return true]],[[-- 恢复手势-恢复当前应用快捷手势 -将下面应用名称改成你所需要恢复的应用名称，备注。
按钮列表=
{
{"%程序设置$500","高级设置>50$500","资源管理>50$500","备份管理>50$500",
"QQ*|%向下翻页>10",
"恢复|%向下翻页>10","%返回<3$500"},
}
service.click(按钮列表)
return true]],[[-- 我要用-用于启用-停用-当前单程序快捷手势 -将下面的应用名称改成你所需要的应用名称 -备注
按钮列表=
{
{"%程序设置$500","操作设置>50$500","单应用手势方案(实验性功能)*>50$500",
"QQ|%向下翻页>10",
"确定|%向下翻页>10","%返回<2$500"},
}
service.click(按钮列表)
return true]],[[-- 更新手势-如果你重新设置了快捷手势-请点这里即可快速生效 -备注。
按钮列表=
{
{"%程序设置$500","操作设置>50$500","手势方案设置>50$500","%返回<4$500"},
}
service.click(按钮列表)
return true]],[[您也想要通过解说来写姐说的符号面板，那么你就可以在符号面板写完之后，后面再加上这串代码，注意别加错地方哦，不然如果语法错误就怪不得人了，当然，我在这里说的是，你自己给你一个啥都没有的编辑框给你写，而不是借用其他人的符号面板进行修改的情况下就可以用到这个。
}
  require "import"
  import "android.widget.*"
  import "com.androlua.*"


  layout={
    GridView,
    id="grid",
    numColumns=5,
    --items=符号,
    layout_width="fill",
    layout_height="fill"
  }

  dlg=LuaDialog(service)
  dlg.View=loadlayout(layout)
  grid.adapter=SingleLineAdapter(service,String(符号))
  dlg.setButton("关闭符号面板",nil)
  dlg.show()
  grid.onItemClick=function(l,v)
    dlg.dismiss()
    task(500,function()
      service.insert(node,v.text)
    end)
  end
  return true]],
    [[\n--换行]],
    [[对话框()
.设置标题("标题")
.设置消息("消息")
.设置积极按钮("确定",function()
  显示消息("点击了确定")
end)
.设置消极按钮("取消")
.显示()]],
    [[--本代码味精测试，除解说编辑之外其他保证可用。
--延迟执行代码。
task(500,function()
--延迟之后执行的事件
end)]],
    [[加载网页("")]],
    [[进入子页面("")]],
[[--复制当前页面链接
弹出消息("已复制当前页面链接")
复制文本(webView.getTitle().."\n"..webView.getUrl());]],    [[--本代码貌似仅fusion app可用。
--打开fusion app策划兰代码。
drawerLayout.openDrawer(3)function onKeyDown(key,event)
  if(key==4)then
    if drawerLayout.isDrawerOpen(3) or drawerLayout.isDrawerOpen(5) then
     退出页面()
    elseif(webView.canGoBack())then
      webView.goBack()
    else
      this.finish()
    end
    return true
  end
end]],
    [[--本代码除解说外都可用。
--播放音频代码。
--程序启动时会执行的事件
--打包安装后才能播放哈，别再fa里直接运行

import "android.media.MediaPlayer"
import "java.io.*"

local m=MediaPlayer()
function 播放(path)
  m.reset()
  m.setDataSource(path)
  m.prepare()
  m.start()
end
路径=this.getFilesDir().toString().."/drawable/Music name.mp3"
file,err=io.open(路径)
if err==nil then
 
  播放(路径)
else
  
--播放失败执行事件(自己写)
end]],
[[--延迟执行代码
task(500,function()
--延迟之后执行的事件
end)]],
[[--输入密码执行事件(本代码密码只能输入数字)
InputLayout={
  LinearLayout;
  orientation="vertical";
  Focusable=true,
  FocusableInTouchMode=true,
  {
    EditText;
    hint="在这里输入";
    InputType="number";--限制只能输入数字，此行删除即可输入数字以外的东西
    layout_marginTop="5dp";
    layout_width="80%w";
    layout_gravity="center",
    id="edit";
  };
};

AlertDialog.Builder(this)
.setTitle("请输入密码")
.setView(loadlayout(InputLayout))
.setPositiveButton("确定",{onClick=function(v) 
    if(edit.Text=="123456789")then--这是密码，可修改
      进入子页面("page name")--密码正确时执行的事件
      else
      退出程序()--密码错误时执行的事件
      end
    end})
.setNegativeButton("取消",nil)
.show()]],
[[[[--输入密码执行事件(本代码密码支持所有字符符号的输入)
InputLayout={
  LinearLayout;
  orientation="vertical";
  Focusable=true,
  FocusableInTouchMode=true,
  {
    EditText;
    hint="在这里输入";
    layout_marginTop="5dp";
    layout_width="80%w";
    layout_gravity="center",
    id="edit";
  };
};

AlertDialog.Builder(this)
.setTitle("请输入密码")
.setView(loadlayout(InputLayout))
.setPositiveButton("确定",{onClick=function(v) 
    if(edit.Text=="123456789")then--这是密码，可修改
      进入子页面("page name")--密码正确时执行的事件
      else
      退出程序()--密码错误时执行的事件
      end
    end})
.setNegativeButton("取消",nil)
.show()]],
    [[--设置列表对话框（列表项目名称可自定义）
items={"项目1","项目2","项目3","项目4","项目5","项目6"}--创建有数据的列表，添加即在后面加上   ,"项目名称"
AlertDialog.Builder(this) 
.setTitle("列表对话框")--设置标题
--给列表对话框设置点击事件
.setItems(items,{onClick=function(l,v) 
    --注：与创建有数据的列表项目名称必须一样
    if items[v+1]=="项目1" then
      弹出消息("点击了1")
    elseif items[v+1]=="项目2" then
      弹出消息("点击了2")
    elseif items[v+1]=="项目3" then
      弹出消息("点击了3")
    elseif items[v+1]=="项目4" then
      弹出消息("点击了4")
    elseif items[v+1]=="项目5" then
      弹出消息("点击了5")
    elseif items[v+1]=="项目6" then
      弹出消息("点击了6")
    end
  end}) 
.show()--显示弹窗，删除这行则不显示。]],
[[--检测当前使用的网络
manager = activity.getSystemService(Context.CONNECTIVITY_SERVICE); 
gprs = manager.getNetworkInfo(ConnectivityManager.TYPE_MOBILE).getState(); 
if tostring(gprs)== "CONNECTED" then
--检测到数据网络执行事件
  print--打印文本
"当前数据网络，注意流量使用"
end
connManager = activity.getSystemService(Context.CONNECTIVITY_SERVICE)
mWifi = connManager.getNetworkInfo(ConnectivityManager.TYPE_WIFI);
if tostring(mWifi):find("none)") then
  --未连接任何网络执行事件
else
  --已连接到网络执行事件
  弹出消息("当前wifi网络")
end
--使用方法：将本代码放入程序启动事件程序启动后将会自动检测网络。]],
[[items={}
for i=1,5 do
  table.insert(items,"页面"..tostring(i))
end
AlertDialog.Builder(this)
.setTitle("Just记事本")
.setItems(items,{onClick=function(l,v) 
    if v==0 then
      prompt="写入文字"
notetitle="页面1"
prompt="写入文字"
txtroute="/data/data/"..activity.getPackageName().."/savenote1.xml"
import "java.io.File"
File(txtroute).createNewFile()
note=io.open(txtroute):read("*a")
layout={LinearLayout,
  layout_width="fill",
  layout_height="fill",
  orientation=1,
  {EditText,
    id="aa1",
    layout_height="wrap_content",
    hint=prompt,
    Text=note,
    inputType="textMultiLine",
    layout_width="fill",
    ems="10"},
}
local dl=AlertDialog.Builder(activity)
.setTitle(notetitle)
.setView(loadlayout(layout))
.setPositiveButton("保存",DialogInterface.OnClickListener{
onClick=function()   
if (#aa1.Text~=0)then
note=aa1.Text
io.open(txtroute,"w+"):write(note):close()
else
note=""
io.open(txtroute,"w+"):write(note):close()
end
 end})
.setNegativeButton("取消",function()
  end)
.create()
.show()
    end  
    if v==1 then
      prompt="写入文字"
notetitle="页面2"
prompt="写入文字"
txtroute="/data/data/"..activity.getPackageName().."/savenote2.xml"
import "java.io.File"
File(txtroute).createNewFile()
note=io.open(txtroute):read("*a")
layout={LinearLayout,
  layout_width="fill",
  layout_height="fill",
  orientation=1,
  {EditText,
    id="aa1",
    layout_height="wrap_content",
    hint=prompt,
    Text=note,
    inputType="textMultiLine",
    layout_width="fill",
    ems="10"},
}
local dl=AlertDialog.Builder(activity)
.setTitle(notetitle)
.setView(loadlayout(layout))
.setPositiveButton("保存",DialogInterface.OnClickListener{
onClick=function()   
if (#aa1.Text~=0)then
note=aa1.Text
io.open(txtroute,"w+"):write(note):close()
else
note=""
io.open(txtroute,"w+"):write(note):close()
end
 end})
.setNegativeButton("取消",function()
  end)
.create()
.show()
    end
if v==2 then
      prompt="写入文字"
notetitle="页面3"
prompt="写入文字"
txtroute="/data/data/"..activity.getPackageName().."/savenote3.xml"
import "java.io.File"
File(txtroute).createNewFile()
note=io.open(txtroute):read("*a")
layout={LinearLayout,
  layout_width="fill",
  layout_height="fill",
  orientation=1,
  {EditText,
    id="aa2",
    layout_height="wrap_content",
    hint=prompt,
    Text=note,
    inputType="textMultiLine",
    layout_width="fill",
    ems="10"},
}
local dl=AlertDialog.Builder(activity)
.setTitle(notetitle)
.setView(loadlayout(layout))
.setPositiveButton("保存",DialogInterface.OnClickListener{
onClick=function()   
if (#aa1.Text~=0)then
note=aa1.Text
io.open(txtroute,"w+"):write(note):close()
else
note=""
io.open(txtroute,"w+"):write(note):close()
end
 end})
.setNegativeButton("取消",function()
  end)
.create()
.show()
    end
if v==3 then
          prompt="写入文字"
notetitle="页面4"
prompt="写入文字"
txtroute="/data/data/"..activity.getPackageName().."/savenote4.xml"
import "java.io.File"
File(txtroute).createNewFile()
note=io.open(txtroute):read("*a")
layout={LinearLayout,
  layout_width="fill",
  layout_height="fill",
  orientation=1,
  {EditText,
    id="aa1",
    layout_height="wrap_content",
    hint=prompt,
    Text=note,
    inputType="textMultiLine",
    layout_width="fill",
    ems="10"},
}
local dl=AlertDialog.Builder(activity)
.setTitle(notetitle)
.setView(loadlayout(layout))
.setPositiveButton("保存",DialogInterface.OnClickListener{
onClick=function()   
if (#aa1.Text~=0)then
note=aa1.Text
io.open(txtroute,"w+"):write(note):close()
else
note=""
io.open(txtroute,"w+"):write(note):close()
end
 end})
.setNegativeButton("取消",function()
  end)
.create()
.show()
    "end1.xml"
import "java.io.File"
File(txtroute).createNewFile()
note=io.open(txtroute):read("*a")
layout={LinearLayout,
  layout_width="fill",
  layout_height="fill",
  orientation=1,
  {EditText,
    id="aa1",
    layout_height="wrap_content",
    hint=prompt,
    Text=note,
    inputType="textMultiLine",
    layout_width="fill",
    ems="10"},
}
local dl=AlertDialog.Builder(activity)
.setTitle(notetitle)
.setView(loadlayout(layout))
.setPositiveButton("保存",DialogInterface.OnClickListener{
onClick=function()   
if (#aa1.Text~=0)then
note=aa1.Text
io.open(txtroute,"w+"):write(note):close()
else
note=""
io.open(txtroute,"w+"):write(note):close()
end
 end})
.setNegativeButton("取消",function()
  end)
.create()
.show()
    end
    if v==4 then
      prompt="写入文字"
notetitle="页面5"
prompt="写入文字"
txtroute="/data/data/"..activity.getPackageName().."/savenote5.xml"
import "java.io.File"
File(txtroute).createNewFile()
note=io.open(txtroute):read("*a")
layout={LinearLayout,
  layout_width="fill",
  layout_height="fill",
  orientation=1,
  {EditText,
    id="aa1",
    layout_height="wrap_content",
    hint=prompt,
    Text=note,
    inputType="textMultiLine",
    layout_width="fill",
    ems="10"},
}
local dl=AlertDialog.Builder(activity)
.setTitle(notetitle)
.setView(loadlayout(layout))
.setPositiveButton("保存",DialogInterface.OnClickListener{
onClick=function()   
if (#aa1.Text~=0)then
note=aa1.Text
io.open(txtroute,"w+"):write(note):close()
else
note=""
io.open(txtroute,"w+"):write(note):close()
end
 end})
.setNegativeButton("取消",function()
  end)
.create()
.show()
    end 
  end})
.show()]],[[10010]], [[.","@126.com]],
  [[@qq.com]],
  [[@163.com]],
  [[@139.com]],
  [[@gmail.com]],



    [[},
]],


  }
  require "import"
  import "android.widget.*"
  import "com.androlua.*"


  layout={
    GridView,
    id="grid",
    numColumns=1,
    --items=符号,
    layout_width="fill",
    layout_height="fill"
  }

  dlg=LuaDialog(service)
  dlg.View=loadlayout(layout)
  grid.adapter=SingleLineAdapter(service,String(符号))
  dlg.setButton("点击这里可以关闭符号面板这个窗口哦！",nil)
  dlg.show()
  grid.onItemClick=function(l,v)
    dlg.dismiss()
    task(1,function()
      service.insert(node,v.text)
    end)
  end
  return true