-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathmain4.lua
More file actions
198 lines (189 loc) · 4.38 KB
/
main4.lua
File metadata and controls
198 lines (189 loc) · 4.38 KB
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
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
import "android.app.*"
import "android.os.*"
import "android.widget.*"
import "android.view.*"
import "toast"
import "com.androlua.LuaEditor"
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
attrsArray = { android.R.attr.selectableItemBackgroundBorderless }
typedArray =activity.obtainStyledAttributes(attrsArray)
ripple=typedArray.getResourceId(0, attrsArray[1]);
typedArray.recycle();
layout4={
LinearLayout;
orientation="vertical";
layout_width="fill";
layout_height="fill";
{
RelativeLayout;
layout_height="fill";
layout_width="fill";
{
LinearLayout;
layout_width="fill";
layout_height="50dp";
backgroundColor=颜色1;
{
ImageView;
layout_width="25dp";
onClick=function()
activity.finish()
end;
layout_gravity="center";
ColorFilter="0xFF03A9F4";
src="res/AndLuaXY8.png";
id="mImageView1";
backgroundResource=ripple,
layout_marginLeft="20dp";
};
{
TextView;
textColor="0xFF03A9F4";
layout_gravity="center";
textSize="18sp";
text="中文手册";
id="oi";
layout_marginLeft="30dp";
};
};
{
LinearLayout;
layout_width="fill";
visibility=8;
layout_height="50dp";
id="选择代码";
backgroundColor=颜色1;
{
ImageView;
layout_width="30dp";
layout_marginLeft="10dp";
layout_gravity="center";
ColorFilter="0xFF03A9F4";
layout_height="30dp";
id="XY0";
src="res3/1.png";
};
{
TextView;
layout_gravity="center";
textSize="18sp";
textColor="0xFF03A9F4";
text="选择代码";
layout_marginLeft="15dp";
};
{
ImageView;
layout_width="29dp";
layout_marginLeft="30dp";
layout_gravity="center";
ColorFilter="0xFF03A9F4";
layout_height="29dp";
id="XY1";
src="res3/2.png";
};
{
ImageView;
layout_width="25dp";
layout_marginLeft="25dp";
layout_gravity="center";
ColorFilter="0xFF03A9F4";
layout_height="25dp";
id="XY2";
src="res3/3.png";
};
{
ImageView;
layout_width="25dp";
layout_marginLeft="25dp";
layout_gravity="center";
ColorFilter="0xFF03A9F4";
layout_height="25dp";
id="XY3";
src="res3/4.png";
};
{
ImageView;
layout_width="25dp";
layout_marginLeft="25dp";
layout_gravity="center";
ColorFilter="0xFF03A9F4";
layout_height="25dp";
id="XY4";
src="res3/5.png";
};
};
{
LinearLayout;
layout_width="fill";
layout_height="100%h";
layout_marginTop="50dp";
{
LuaEditor;
TextSize="12sp";
id="r";
backgroundColor=颜色2,
};
};
};
};
activity.setContentView(loadlayout(layout4))
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
参数,参数1=...
oi.text=参数
r.text=参数1
activity.getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_RESIZE)
r.OnSelectionChangedListener=function(a,b,c,d)
if a==true then
选择代码.setVisibility(0)
else
选择代码.setVisibility(8)
end
end
function XY1.onClick()
r.selectAll()
end
function XY2.onClick()
r.cut()
end
function XY3.onClick()
r.copy()
end
function XY4.onClick()
r.paste()
end
r.setBasewordColor(0xff8dbdc9)
r.setPanelBackgroundColor(颜色1)
r.setPanelTextColor(0xFF03A9F4)
r.setStringColor(0xFF03A9F4)
r.setTextColor(颜色3)
r.setUserwordColor(0xFF03A9F4)
r.setCommentColor(0xffa0a0a0)
r.setKeywordColor(0xFF03A9F4)
a={"删除文件()","获取悬浮窗权限()"}
r.addNames(a)
p={
LinearLayout;
layout_width="40dp";
gravity="center";
layout_height="fill";
{
TextView;
id="符号文本1";
text="Fun";
textSize="15sp";
textColor="0xFF03A9F4";
};
};