-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathmain49.lua
More file actions
262 lines (250 loc) · 6.72 KB
/
main49.lua
File metadata and controls
262 lines (250 loc) · 6.72 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
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
require "import"
import "android.app.*"
import "android.os.*"
import "android.widget.*"
import "mods.SnackerBar"
import "android.content.Intent"
import "android.net.Uri"
import "java.net.URLDecoder"
import "java.io.File"
import "android.content.Intent"
import "android.content.Intent"
import "android.net.Uri"
import "java.net.URLDecoder"
import "android.content.*"
import "android.view.inputmethod.InputMethodManager"
import "console"
import "android.view.*"
import "android.graphics.Typeface"
import "java.io.File"
import "android.view.animation.*"
import "android.view.animation.Animation"
import "android.graphics.*"
import "mods.andlua"
import "android.graphics.PorterDuffColorFilter"
import "android.graphics.PorterDuff"
import "android.text.SpannableString"
import "android.text.style.ForegroundColorSpan"
import "android.text.Spannable"
import "android.graphics.drawable.ColorDrawable"
import "android.graphics.Color"
import "android.support.v4.widget.*"
require "permission"
import "autotheme"
import "android.graphics.PorterDuffColorFilter"
import "android.graphics.PorterDuff"
import "android.graphics.drawable.ColorDrawable"
import "android.text.SpannableString"
import "android.text.style.ForegroundColorSpan"
import "android.text.Spannable"
import "mods.andlua"
import "mods.SnackerBar"
import "mods.lay"
ztt()
main10 = {
LinearLayout,
layout_width = "fill",
layout_height = "fill",
backgroundColor = AndLuaB,
{
RelativeLayout,
layout_width = "fill",
layout_height = "fill",
{
TextView,
textSize = "15sp",
layout_centerInParent = "true",
text = getLS("L_No_project"),
textColor = "#000000",
id = "wgc",
},
{
SwipeRefreshLayout,
layout_marginLeft = "5dp",
layout_marginRight = "5dp",
layout_marginTop = "5dp",
id = "sxlist",
{
YLListView,
VerticalScrollBarEnabled = false,
overScrollMode = 2,
id = "list",
VerticalScrollBarEnabled = false,
layout_width = "-1",
layout_height = "-1",
DividerHeight = 0
},
},
},
};
activity.setContentView(loadlayout(main10))
ztt()
ztl()
btl = {
LinearLayout,
layout_width = "fill",
elevation = "1dp",
layout_height = "55dp",
orientation = "horizontal",
{
LinearLayout,
layout_width = "55dp",
gravity = "center",
id = "Sideslip",
layout_height = "55dp",
layout_marginLeft = "-15dp",
{
ImageView,
layout_height = "25dp",
colorFilter = tonumber(bjzt()),
layout_width = "28dp",
src = "res/off.png",
},
},
{
LinearLayout,
layout_height = "fill",
layout_weight = "1",
orientation = "horizontal",
{
TextView,
layout_gravity = "center",
textSize = "18sp",
text = getLS("L_The_import_material"),
textColor = tonumber(bjzt()),
id = "bt",
singleLine = true,
},
},
};
activity.ActionBar.setDisplayShowCustomEnabled(true)
activity.ActionBar.setCustomView(loadlayout(btl))
activity.ActionBar.setBackgroundDrawable(ColorDrawable(AndLuaB1))
activity.ActionBar.setElevation(0)
dz, dz1 = ...
bw(Sideslip, 0x5FFFFFFF)
Sideslip.onClick = function()
activity.finish()
end
function gxlbb(ggh, bbt, bh, bmh, g)
adp3.add { tb = ggh, bt = bbt, bb = bh, bmb = bmh, gcv = g, gcu = ggh }
end
sxlist.setRefreshing(true);
adp3 = LuaAdapter(activity, lap)
list.setAdapter(adp3)
function sjj()
end
function szlb(hkqq)
if hkqq == "0" then
wgc.setVisibility(View.VISIBLE)
else
wgc.setVisibility(View.GONE)
end
sxlist.setRefreshing(false);
end
function ddd()
adp3.clear()
end
function sxgg()
require "import"
import "java.io.File"
import "mods.andlua"
call("sjj")
function show(f)
dir = f
call("ddd")
ls = luajava.astable(f.listFiles() or String {})
table.sort(ls, function(a, b)
return (a.isDirectory() ~= b.isDirectory() and a.isDirectory()) or
((a.isDirectory() == b.isDirectory()) and a.Name < b.Name)
end)
if #ls == 0 then
hkqq = "0"
else
hkqq = "1"
for n = 1, #ls do
bbm = ls[n].Name
gg = ("/sdcard/AndLua/project/" .. ls[n].Name .. "/init.lua")
if File(gg).isFile() then
pdd = ("/sdcard/AndLua/project/" .. ls[n].Name .. "/main.lua")
file, err = io.open(pdd)
if err == nil then
ggh = ("/sdcard/AndLua/project/" .. ls[n].Name .. "/icon.png")
if File(ggh).isFile() then
else
ggh = activity.getLuaDir() .. "/icon.png"
end
g = ("/sdcard/AndLua/project/" .. ls[n].Name)
wj = io.open(gg):read("*a")
bbt = wj:match('%appname="(.-)"')
bh = getLS("L_Version") .. ": " .. wj:match('%appver="(.-)"')
bmh = getLS("L_The_package_name") .. ": " .. wj:match('%kagename="(.-)"')
call("gxlbb", ggh, bbt, bh, bmh, g)
else
end
end
end
end
end
show(File("/sdcard/AndLua/project/"))
call("szlb", hkqq)
end
thread(sxgg)
sxlist.setColorSchemeColors({ tonumber(bjzt()) });
sxlist.setOnRefreshListener(SwipeRefreshLayout.OnRefreshListener { onRefresh = function()
thread(sxgg)
end })
list.onItemClick = function(l, v, p, i)
pm = v.Tag.gcv.Text .. "/res/" .. dz1
if File(v.Tag.gcv.Text).isDirectory() then
if File(pm).isFile() then
AlertDialog.Builder(this)
.setTitle(getLS("L_Prompt"))
.setMessage(getLS("L_Whether_the_material_has_been_in_existence"))
.setPositiveButton(getLS("L_Cover"), {
onClick = function(v)
if LuaUtil.copyDir(dz, pm) then
SnackerBar.build()
:msg(getLS("L_Import_success"))
:actionText(getLS("L_OK"))
:action(function()
end)
:show()
else
SnackerBar.build()
:msg(getLS("L_Import_failure"))
:actionText(getLS("L_OK"))
:action(function()
end)
:show()
end
end
})
.setNegativeButton(getLS("L_Cancel"), nil)
.show()
else
if LuaUtil.copyDir(dz, pm) then
SnackerBar.build()
:msg(getLS("L_Import_success"))
:actionText(getLS("L_OK"))
:action(function()
end)
:show()
else
SnackerBar.build()
:msg(getLS("L_Import_failure"))
:actionText(getLS("L_OK"))
:action(function()
end)
:show()
end
end
else
SnackerBar.build()
:msg(getLS("L_This_project_does_not_exist"))
:actionText(getLS("L_OK"))
:action(function()
end)
:show()
end
end