-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathmain10.lua
136 lines (130 loc) · 2.89 KB
/
main10.lua
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
import "android.app.*"
import "android.os.*"
import "android.widget.*"
import "android.view.*"
import "lj"
import "toast"
import "android"
import "com.androlua.LuaAdapter"
local a=io.open(activity.getLuaDir().."/Verify/set4.XY"):read("*a")
local ip=a:match("2(.-)"..'"')
if ip=="开" then
颜色1=0xff303030
颜色2=0xff212121
颜色3=0xffffffff
else
颜色1=0xffffffff
颜色3=0xff303030
颜色2=0xFFF2F1F6
end
layout10={
LinearLayout;
layout_width="fill";
layout_height="fill";
backgroundColor=颜色2,
orientation="vertical";
{
LinearLayout;
orientation="vertical";
layout_height="fill";
layout_width="fill";
{
LinearLayout;
backgroundColor=颜色1;
layout_height="56dp";
layout_width="fill";
{
ImageView;
onClick=function()
activity.finish()
end;
src="res/AndLuaXY8.png";
layout_marginLeft="20dp";
ColorFilter="0xFF03A9F4";
layout_width="25dp";
layout_gravity="center";
};
{
TextView;
textSize="18sp";
textColor="0xFF03A9F4";
layout_marginLeft="30dp";
text="Java Api";
layout_gravity="center";
};
};
{
EditText;
hint="搜索",
layout_marginTop="10dp",
id="搜索api";
hintTextColor=颜色3,
textColor=颜色3,
layout_width="320dp";
layout_gravity="center";
};
{
LinearLayout;
layout_height="match_parent";
layout_width="match_parent";
{
ListView;
fastScrollEnabled=true,
layout_marginTop="10dp",
DividerHeight=0;
id="api";
layout_height="fill";
layout_width="fill";
};
};
};
};
activity.setContentView(loadlayout(layout10))
activity.getWindow().addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS).setStatusBarColor(颜色1);
if tonumber(Build.VERSION.SDK) >= 23 then
activity.getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR);
end
控件圆角(搜索api,颜色2,25)
apiitem={
LinearLayout;
layout_height="fill";
layout_width="fill";
gravity="center";
backgroundColor=颜色2,
{
LinearLayout;
layout_width="match_parent";
{
TextView;
textSize="17sp";
id="nrapi";
textColor=颜色3;
layout_marginLeft="25dp";
layout_marginTop="10dp";
layout_marginBottom="10dp";
text="com.androlua.Http";
};
};
};
data={}
local adp=LuaAdapter(activity,data,apiitem)
api.setAdapter(adp)
function 加载(内容)
adp.clear()
for k in apinr:gmatch("【(.-)】")
if k:match(tostring(内容)) then
adp.add{nrapi=k}
else
adp.clear()
end
end
end
加载("")
搜索api.addTextChangedListener({
onTextChanged=function(a)
加载(a)
end})
function api.onItemClick(l,v,p,i)
写入剪切板(v.tag.nrapi.text)
print"复制成功"
end