using HDL_ON.Stan;
using Shared;
using System;
using System.Collections.Generic;
using System.Text;
namespace HDL_ON.UI
{
///
/// 添加Evoyo的Mini智能遥控器步骤1界面
///
public class AddMiniRemoteControlDirection1Page : EditorCommonForm
{
#region ■ 变量声明___________________________
///
/// 添加设备完成之后的回调事件(温总说他自己要这个东西)
///
public Action AddDeviceEvent = null;
#endregion
#region ■ 初始化_____________________________
///
/// 画面显示(底层会固定调用此方法,借以完成画面创建)
///
public void ShowForm()
{
//设置头部信息
base.SetTitleText(Language.StringByID(StringId.AddInfraredRemoteControl));
//这个界面的背景需要白色
bodyFrameLayout.BackgroundColor = UI.CSS.CSS_Color.MainBackgroundColor;
//初始化中部信息
this.InitMiddleFrame();
}
///
/// 初始化中部信息
///
private void InitMiddleFrame()
{
//图片
var btnPic = new PicViewControl(149, 95);
btnPic.Y = Application.GetRealHeight(99);
btnPic.Gravity = Gravity.CenterHorizontal;
btnPic.UnSelectedImagePath = "PersonalCenter/AddDevice/MiniRemoteControlBigPictrue.png";
bodyFrameLayout.AddChidren(btnPic);
//长按红外遥控器按钮10秒,指示灯蓝色快闪
var strMsg = Language.StringByID(StringId.AddInfraredRemoteControlMsg1);
var listContr = this.AddListMsgControls(bodyFrameLayout, strMsg, CSS.CSS_FontSize.TextFontSize,
CSS.CSS_Color.FirstLevelTitleColor, Application.GetRealHeight(20), Application.GetRealHeight(408));
//请确保您的蓝牙已开启并处于可以被搜索状态
strMsg = Language.StringByID(StringId.AddInfraredRemoteControlMsg2);
this.AddListMsgControls(bodyFrameLayout, strMsg, CSS.CSS_FontSize.PromptFontSize_FirstLevel,
CSS.CSS_Color.PromptingColor1, Application.GetRealHeight(18), listContr[listContr.Count - 1].Bottom + Application.GetRealHeight(4));
//下一步
var btnNext = this.AddBottomClickButton(Language.StringByID(StringId.Next));
btnNext.ButtonClickEvent += (sender, e) =>
{
//检测蓝牙需要的东西
btnNext.CanClick = false;
HdlBluetoothLogic.Current.CheckCanScanBluetooth((result) =>
{
btnNext.CanClick = true;
if (result == true)
{
//注意:这个界面不能关闭,它用来回调温总的界面用的
var form = new AddMiniRemoteControlDirection2Page();
//初始wifi和密码为空
form.AddForm(string.Empty, string.Empty);
}
});
};
}
#endregion
#region ■ 关闭界面___________________________
///
/// 关闭界面
///
public override void CloseFormBefore()
{
this.AddDeviceEvent = null;
base.CloseFormBefore();
}
#endregion
}
}