---
--- Generated by EmmyLua(https://github.com/EmmyLua)
--- Created by XiongFangyu.
--- DateTime: 2019-08-20 18:41
---
local screenWidth = window:width()
local USB_CONNECTION = 1
local NET_CONNECTION = 2
local connectType = 1

local extra = window:getExtra()
local urlParams = extra:get('urlParams')
local ct;
if urlParams then
	ct = urlParams:get('ct')
else
	ct = extra:get('ct')
end
if ct then
	connectType = tonumber(ct)
end

local titleColor = Color(0,0,0,1)
local titleSize = 20
local normalColor = Color(50,50,50,1)
local normalSize = 16

local baseView = ScrollView(false, true)

local preActions = {
	function (baseView)
		local connectSuccessLabel = Label():text('进入USB连接，请选择对应设备'):setGravity(Gravity.CENTER):fontSize(25)
		baseView:addView(connectSuccessLabel)
	end,
	function (baseView)
		local connectSuccessLabel = Label():text('连接成功wifi成功'):setGravity(Gravity.CENTER):fontSize(25)
		baseView:addView(connectSuccessLabel)
	end
}

preActions[connectType](baseView)

local function makeTitle(text)
    return Label():text(text):textColor(titleColor):fontSize(titleSize):lines(1):marginBottom(10):marginTop(10)
end

local function makeNormal(text)
    return Label():text(text):textColor(normalColor):fontSize(normalSize):lines(10):marginBottom(5):marginTop(5)
end

local function makeImage(url)
    return ImageView():image(url):width(screenWidth):height(MeasurementType.WRAP_CONTENT)
end

local selectDevice = makeTitle('1.选择您的设备')
local selectDevice2 = makeNormal('点击LuaNative -> Devices Info -> iOS Device(Android Device) 选择对应设备，如图:')
local selectDevice3 = makeImage('http://cdnst.momocdn.com/w/u/others/2019/08/21/1566356709994-lua_select_device_1.png')
local selectDevice4 = makeNormal('连接成功后，右边将出现日志栏，如图:')
local selectDevice5 = makeImage('http://cdnst.momocdn.com/w/u/others/2019/08/21/1566356710106-lua_select_device_2.png')
baseView:addView(selectDevice):addView(selectDevice2):addView(selectDevice3):addView(selectDevice4):addView(selectDevice5)

local entrySet = makeTitle('2.设置入口文件')
local entrySet2 = makeNormal('右键想要调试的lua文件 -> Mark as entry file，即可将当前lua文件设置为入口。(取消入口，同样右键 UnMark as entry file)\n⚠️仅src下的lua文件可作为入口。如图:')
local entrySet3 = makeImage('http://cdnst.momocdn.com/w/u/others/2019/08/21/1566356710106-lua_set_entry.png')
local entrySet4 = makeNormal('设置好入口之后，控制面板中Entry File中便会新增对应入口。选择Entry File中对应的lua入口，点击刷新，扫码包界面便会同步显示执行结果。\n若自动同步开启之后，当前入口会实时更新，修改文件或切换入口便可快速切换界面；若关闭自动同步，需点击“刷新”更新界面。')
baseView:addView(entrySet):addView(entrySet2):addView(entrySet3):addView(entrySet4)

window:addView(baseView)