From 675df74cdd4103ffdcbfa0a6ccfc105fd61af15a Mon Sep 17 00:00:00 2001
From: JLChen <551775569@qq.com>
Date: 星期五, 29 十月 2021 15:44:18 +0800
Subject: [PATCH] 2021-10-29 1.更新乐橙 AndroidSDK
---
HDL_ON/UI/UI2/FuntionControlView/Electrical/IrFanPage.cs | 241 +++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 237 insertions(+), 4 deletions(-)
diff --git a/HDL_ON/UI/UI2/FuntionControlView/Electrical/IrFanPage.cs b/HDL_ON/UI/UI2/FuntionControlView/Electrical/IrFanPage.cs
index ab85ff9..11604ef 100644
--- a/HDL_ON/UI/UI2/FuntionControlView/Electrical/IrFanPage.cs
+++ b/HDL_ON/UI/UI2/FuntionControlView/Electrical/IrFanPage.cs
@@ -1,10 +1,243 @@
锘縰sing System;
-namespace HDL_ON.UI.UI2.FuntionControlView.Electrical
+using System.Collections.Generic;
+using HDL_ON.DriverLayer;
+using HDL_ON.Entity;
+using HDL_ON.Stan;
+using HDL_ON.UI.CSS;
+using Shared;
+
+namespace HDL_ON.UI
{
- public class IrFanPage
+ public class IrFanPage : DeviceFunctionCardCommonForm
{
- public IrFanPage()
+ #region 鈻� 鍙橀噺澹版槑___________________________
+
+ /// <summary>
+ /// 鍥炬爣
+ /// </summary>
+ private Button btnIcon = null;
+
+ #endregion
+
+ #region 鈻� 鍒濆鍖朹____________________________
+
+ /// <summary>
+ /// 鍒濆鍖栫櫧鑹插尯鍩熺殑鍐呭
+ /// </summary>
+ public override void InitFrameWhiteContent()
+ {
+ base.ShowColltionButton = false;
+ base.SetTitleText(Language.StringByID(StringId.Electric));
+
+ //鍒濆鍖栫涓�涓储寮曢〉鐨勫唴瀹�
+ this.InitFrameWhiteContent1();
+
+ }
+
+ /// <summary>
+ /// 鍒濆鍖栫涓�涓储寮曢〉鐨勫唴瀹�
+ /// </summary>
+ private void InitFrameWhiteContent1()
+ {
+ btnIcon = new Button()
+ {
+ Gravity = Gravity.CenterHorizontal,
+ Y = Application.GetRealHeight(88),
+ Width = Application.GetRealWidth(134),
+ Height = Application.GetRealWidth(134),
+ UnSelectedImagePath = "FunctionIcon/IrFan/FanIcon.png",
+ };
+ FrameWhiteCentet1.AddChidren(btnIcon);
+
+ var patternView = new IrFanControl("FunctionIcon/IrFan/PatternIcon.png",
+ "FunctionIcon/IrFan/PatternIconOn.png",
+ Language.StringByID(StringId.Mode),
+ "");
+ patternView.Y = Application.GetRealHeight(263);
+ patternView.X = Application.GetRealWidth(36);
+ patternView.Width = Application.GetRealWidth(96);
+ patternView.Height = Application.GetRealHeight(74);
+ FrameWhiteCentet1.AddChidren(patternView);
+ EventHandler<MouseEventArgs> mode_EventHandler = (sender, e) =>
+ {
+ Dictionary<string, string> d = new Dictionary<string, string>();
+ d.Add("mode", "");
+ Control.Ins.SendWriteCommand(device, d);
+ };
+ patternView.SetThouchEvent(mode_EventHandler);
+
+ var swingView = new IrFanControl("FunctionIcon/IrFan/HeadSwingingIcon.png",
+ "FunctionIcon/IrFan/HeadSwingingIconOn.png",
+ Language.StringByID(StringId.HeadSwinging),
+ "");
+ swingView.Y = Application.GetRealHeight(263);
+ swingView.X = Application.GetRealWidth(229-34);
+ swingView.Width = Application.GetRealWidth(96);
+ swingView.Height = Application.GetRealHeight(74);
+ FrameWhiteCentet1.AddChidren(swingView);
+ EventHandler<MouseEventArgs> swing_EventHandler = (sender, e) =>
+ {
+ Dictionary<string, string> d = new Dictionary<string, string>();
+ d.Add("swing", "");
+ Control.Ins.SendWriteCommand(device, d);
+ };
+ swingView.SetThouchEvent(swing_EventHandler);
+
+
+ var timingView = new IrFanControl("FunctionIcon/IrFan/TimingIcon.png",
+ "FunctionIcon/IrFan/TimingIconOn.png",
+ Language.StringByID(StringId.Timing),
+ "");
+ timingView.Y = Application.GetRealHeight(366);
+ timingView.X = Application.GetRealWidth(36);
+ timingView.Width = Application.GetRealWidth(96);
+ timingView.Height = Application.GetRealHeight(74);
+ FrameWhiteCentet1.AddChidren(timingView);
+ EventHandler<MouseEventArgs> timing_EventHandler = (sender, e) =>
+ {
+ Dictionary<string, string> d = new Dictionary<string, string>();
+ d.Add("timer", "");
+ Control.Ins.SendWriteCommand(device, d);
+ };
+ timingView.SetThouchEvent(timing_EventHandler);
+
+
+ var airVolumeView = new IrFanControl("FunctionIcon/IrFan/SpeedIcon.png",
+ "FunctionIcon/IrFan/SpeedIconOn.png",
+ Language.StringByID(StringId.AirVolume),
+ "");
+ airVolumeView.Y = Application.GetRealHeight(366);
+ airVolumeView.X = Application.GetRealWidth(229 - 34);
+ airVolumeView.Width = Application.GetRealWidth(96);
+ airVolumeView.Height = Application.GetRealHeight(74);
+ FrameWhiteCentet1.AddChidren(airVolumeView);
+ EventHandler<MouseEventArgs> speed_EventHandler = (sender, e) =>
+ {
+ Dictionary<string, string> d = new Dictionary<string, string>();
+ d.Add("speed", "");
+ Control.Ins.SendWriteCommand(device, d);
+ };
+ airVolumeView.SetThouchEvent(speed_EventHandler);
+
+ Button btnPower = new Button()
+ {
+ Gravity = Gravity.CenterHorizontal,
+ Y = Application.GetRealHeight(468),
+ Width = Application.GetRealWidth(32),
+ Height = Application.GetRealWidth(32),
+ UnSelectedImagePath = "FunctionIcon/IrFan/PowerIcon.png",
+ SelectedImagePath = "FunctionIcon/IrFan/PowerIconOn.png"
+ };
+ FrameWhiteCentet1.AddChidren(btnPower);
+ btnPower.MouseDownEventHandler = (sender, e) =>
+ {
+ btnPower.IsSelected = true;
+ };
+ btnPower.MouseUpEventHandler = (sender, e) => {
+ new System.Threading.Thread(() => {
+ Dictionary<string, string> d = new Dictionary<string, string>();
+ d.Add(FunctionAttributeKey.OnOff, "");
+ Control.Ins.SendWriteCommand(device, d);
+ System.Threading.Thread.Sleep(500);
+ Application.RunOnMainThread(() => {
+ btnPower.IsSelected = false;
+ });
+ }) { IsBackground = true }.Start();
+ };
+
+
+ }
+ #endregion
+
+ #region 鈻� 璁惧鐘舵�佸弽棣坃______________________
+
+ /// <summary>
+ /// 璁惧鐘舵�佸弽棣�
+ /// </summary>
+ /// <param name="i_LocalDevice"></param>
+ public override void DeviceStatuPush(Function i_LocalDevice)
{
}
+
+ #endregion
}
-}
+
+ public class IrFanControl : FrameLayout
+ {
+ private Button btnIcon;
+ private Button btnTitle;
+
+ public bool Lighting = false;
+
+
+ public IrFanControl(string unSelectedIconPath, string selectedIconPath, string title, string time)
+ {
+ btnIcon = new Button()
+ {
+ Gravity = Gravity.CenterHorizontal,
+ Width = Application.GetRealWidth(28),
+ Height = Application.GetRealWidth(28),
+ UnSelectedImagePath = unSelectedIconPath,
+ SelectedImagePath = selectedIconPath,
+ };
+ this.AddChidren(btnIcon);
+
+ btnTitle = new Button()
+ {
+ Y = Application.GetRealWidth(28),
+ Text = title,
+ Height = Application.GetRealHeight(30),
+ TextColor = CSS_Color.TextualColor,
+ SelectedTextColor = CSS_Color.MainColor,
+ TextSize = CSS_FontSize.PromptFontSize_FirstLevel,
+ };
+ this.AddChidren(btnTitle);
+
+ }
+
+ public void SetViewStatus(bool state)
+ {
+ btnIcon.IsSelected = btnTitle.IsSelected = Lighting = state;
+ }
+
+ /// <summary>
+ /// 璁剧疆鐐瑰嚮浜嬩欢
+ /// </summary>
+ public void SetThouchEvent(EventHandler<MouseEventArgs> eventHandler)
+ {
+ btnIcon.MouseUpEventHandler = eventHandler;
+ btnTitle.MouseUpEventHandler = eventHandler;
+ btnIcon.MouseDownEventHandler = (sender, e) => {
+ btnTitle.IsSelected = true;
+ btnIcon.IsSelected = true;
+ };
+ btnTitle.MouseDownEventHandler = (sender, e) => {
+ btnTitle.IsSelected = true;
+ btnIcon.IsSelected = true;
+ };
+ btnIcon.MouseUpEventHandler += (sender, e) => {
+ new System.Threading.Thread(() => {
+ System.Threading.Thread.Sleep(500);
+ Application.RunOnMainThread(() =>
+ {
+ btnTitle.IsSelected = false;
+ btnIcon.IsSelected = false;
+ });
+ })
+ { IsBackground = true }.Start();
+ };
+ btnTitle.MouseUpEventHandler += (sender, e) => {
+ new System.Threading.Thread(() => {
+ System.Threading.Thread.Sleep(500);
+ Application.RunOnMainThread(() =>
+ {
+ btnTitle.IsSelected = false;
+ btnIcon.IsSelected = false;
+ });
+ })
+ { IsBackground = true }.Start();
+ };
+
+ }
+ }
+}
\ No newline at end of file
--
Gitblit v1.8.0