From 18c8ba14183bf72fd01e595124a9614bc4c7d6a3 Mon Sep 17 00:00:00 2001
From: wxr <464027401@qq.com>
Date: 星期一, 23 十月 2023 14:34:16 +0800
Subject: [PATCH] 2.3版本
---
HDL_ON/UI/UI2/FuntionControlView/HisenseTV /HisenseTvPage.cs | 115 ++++++++++++++++++++++++++++++---------------------------
1 files changed, 60 insertions(+), 55 deletions(-)
diff --git a/HDL_ON/UI/UI2/FuntionControlView/HisenseTV /HisenseTvPage.cs b/HDL_ON/UI/UI2/FuntionControlView/HisenseTV /HisenseTvPage.cs
index 9685f89..45d58cf 100644
--- a/HDL_ON/UI/UI2/FuntionControlView/HisenseTV /HisenseTvPage.cs
+++ b/HDL_ON/UI/UI2/FuntionControlView/HisenseTV /HisenseTvPage.cs
@@ -93,7 +93,7 @@
this.btnRoomName = btnRoomName;
this.btnCollectionIcon = btnCollectionIcon;
this.comerom = comerom;
- this.action = action;
+ this.action = action;
}
@@ -105,7 +105,7 @@
//鍒濆鍖栦簨浠�
this.EventListener();
//璇诲彇鏁版嵁
- //this.ReadData();
+ this.ReadData();
}
@@ -168,8 +168,7 @@
//寮�鏈�
kaijiFL.SetClickListener((fl, btnImage, btnText) =>
{
- //Send.Current.Open("b7686438");
- ControlCommand(HisenseTVFunctionalAttributeConstant.on_off, "on");
+ ControlCommand(HisenseTVFunctionalAttributeConstant.wol, "on");
});
//鍏虫満
@@ -179,24 +178,24 @@
});
//闊抽噺+
- btn_jia.MouseDownEventHandler += (sender, e) =>
+ btn_jia.MouseUpEventHandler += (sender, e) =>
{
- btn_jia.IsSelected = true;
ControlCommand(HisenseTVFunctionalAttributeConstant.volume_add, "");
+ this.SetButtonIsSelected(btn_jia);
};
//闊抽噺-
- btn_jian.MouseDownEventHandler += (sender, e) =>
+ btn_jian.MouseUpEventHandler += (sender, e) =>
{
- btn_jian.IsSelected = true;
ControlCommand(HisenseTVFunctionalAttributeConstant.volume_subtract, "");
+ this.SetButtonIsSelected(btn_jian);
};
//鑿滃崟
- caidanBtn.SetClickListener((btn) =>
- {
- ControlCommand(HisenseTVFunctionalAttributeConstant.operation, "11");
+ caidanBtn.SetClickListener((btn) =>
+ {
+ ControlCommand(HisenseTVFunctionalAttributeConstant.operation, "11");
- });
+ });
//鎾斁
bofangBtn.SetClickListener((btn) =>
{
@@ -293,6 +292,26 @@
{
try
{
+ if (this.device == null)
+ {
+ //璁惧涓嶅湪绾挎帶鍒跺け璐�
+ Application.RunOnMainThread(() =>
+ {
+ CommonMethod.Current.ShowTip(Language.StringByID(StringId.shebeibuzaixian), 3);
+ });
+ return;
+ }
+
+ if (!this.device.online && key != HisenseTVFunctionalAttributeConstant.wol)
+ {
+ //璁惧涓嶅湪绾挎帶鍒跺け璐�
+ Application.RunOnMainThread(() =>
+ {
+ CommonMethod.Current.ShowTip(Language.StringByID(StringId.shebeibuzaixian), 3);
+ });
+ return;
+ }
+
Dictionary<string, string> dic = new Dictionary<string, string>();
dic.Add(key, value);
Send.Current.SendControlCommand(this.device, dic, action);
@@ -304,14 +323,27 @@
/// </summary>
private void ReadData()
{
+ if (this.device == null)
+ {
+ return;
+ }
CommonMethod.Current.Loading.Start();
CommonMethod.Current.SunThread(() =>
{
try
{
- CommonMethod.Current.MainThread(() =>
+
+ var isRefreshDeviceStatus = Send.Current.RefreshDeviceStatus(new List<string> { this.device.deviceId });
+ if (isRefreshDeviceStatus)
{
- });
+ var fun = Send.Current.GetDeviceInfo(this.device.deviceId);
+ if (fun != null)
+ {
+ //鏇存柊鐪熷疄鍦ㄧ嚎鐘舵��
+ this.device.online = fun.online;
+ }
+
+ }
}
catch { }
finally
@@ -413,7 +445,7 @@
kaijiFL.GetImageButton().SelectedImagePath = "HisenseTv/kaiguanSelected.png";
kaijiFL.GetTextButton().TextID = StringId.kaiji;
- guanFL = new CustomFrameLayout();
+ guanFL = new CustomFrameLayout();
backgroundOpenFl.AddChidren(guanFL);
guanFL.X = kaijiFL.Right + Application.GetRealWidth(37);
guanFL.Y = yHeight;
@@ -467,16 +499,6 @@
};
yinliangFL.AddChidren(btn_jian);
- btn_jia.MouseUpEventHandler += (sender, e) =>
- {
- btn_jia.IsSelected = false;
-
- };
- btn_jian.MouseUpEventHandler += (sender, e) =>
- {
-
- btn_jian.IsSelected = false;
- };
caidanBtn = new CustomButton();
caidanBtn.TextID = StringId.caidan;
@@ -580,7 +602,7 @@
#endregion
}
-
+
/// <summary>
/// 鍒濆鍖栧ご閮�
/// </summary>
@@ -592,7 +614,7 @@
this.topView.topNameBtn.TextID = StringId.dianshi;
this.AddChidren(topView.TopFLayoutView());
}
-
+
/// <summary>
/// 閲嶆柊璁$畻瀹藉害(璁惧鍚嶇О,鎴块棿鎺т欢)
@@ -624,7 +646,7 @@
/// <summary>
/// 鑷畾涔夛紙棣栭〉锛屽叧鏈猴紝鑿滃崟锛夊鍣�
/// </summary>
- class CustomFrameLayout : FrameLayout
+ class CustomFrameLayout : BaseFramLayout
{
public const int widthFrameLayout = 68;
public const int heightFrameLayout = 68 + 8 + 20;
@@ -650,7 +672,7 @@
TextID = StringId.dangqianmenweiguan,
TextSize = TextSize.Text14,
TextColor = MusicColor.TextColor,
- SelectedTextColor= MusicColor.MusicTxet14SelectedColor,
+ SelectedTextColor = MusicColor.MusicTxet14SelectedColor,
TextAlignment = TextAlignment.Center,
Gravity = Gravity.CenterHorizontal,
Name = "btnText",
@@ -682,21 +704,11 @@
/// <param name="button2">娉ㄦ剰:鍦⊿etClickListener()鍓嶉潰璋冪敤AddImageView()鎵嶆湁鏁�</param>
public void SetClickListener(Action<FrameLayout, Button, Button> action)
{
- EventHandler<MouseEventArgs> DownClick = (sender, e) =>
- {
- btnImage.IsSelected = true;
- //btnText.IsSelected = true;
- action?.Invoke(this, btnImage, btnText);
- };
- this.MouseDownEventHandler += DownClick;
- btnImage.MouseDownEventHandler += DownClick;
- btnText.MouseDownEventHandler += DownClick;
-
EventHandler<MouseEventArgs> UpClick = (sender, e) =>
{
- btnImage.IsSelected = false;
- //btnText.IsSelected = false;
+ action?.Invoke(this, btnImage, btnText);
+ SetButtonIsSelected(btnImage);
};
this.MouseUpEventHandler += UpClick;
btnImage.MouseUpEventHandler += UpClick;
@@ -724,7 +736,7 @@
this.BackgroundColor = 0xffECEDEE;
this.SelectedBackgroundColor = 0xFFF2F3F7;
this.Radius = (uint)Application.GetRealHeight(19);
- this.Padding = new Padding(0,0,0,0);
+ this.Padding = new Padding(0, 0, 0, 0);
}
@@ -734,19 +746,12 @@
/// <param name="action">鍥炶皟(绗竴涓槸鐖剁被瀵硅薄</param>
public void SetClickListener(Action<Button> action)
{
- EventHandler<MouseEventArgs> DownClick = (sender, e) =>
- {
- //this.BackgroundColor = 0xFFF2F3F7;
- this.IsSelected = true;
- action?.Invoke(this);
- };
- this.MouseDownEventHandler += DownClick;
-
-
EventHandler<MouseEventArgs> UpClick = (sender, e) =>
{
- //this.BackgroundColor = 0xffECEDEE;
- this.IsSelected = false;
+
+ action?.Invoke(this);
+ new BaseFramLayout().SetButtonIsSelected(this);
+
};
this.MouseUpEventHandler += UpClick;
@@ -817,8 +822,8 @@
TextColor = MusicColor.TextColor,
SelectedTextColor = MusicColor.MusicTxet14SelectedColor,
TextSize = TextSize.Text16,
- TextID =StringId.xinhaoyuan,
- Padding=new Padding(0,0,0,0),
+ TextID = StringId.xinhaoyuan,
+ Padding = new Padding(0, 0, 0, 0),
IsBold = true,
};
--
Gitblit v1.8.0