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/StbPage.cs | 240 ++++++++++++++++++++++++++++++++++++++++++++++++++++-------
1 files changed, 209 insertions(+), 31 deletions(-)
diff --git a/HDL_ON/UI/UI2/FuntionControlView/Electrical/StbPage.cs b/HDL_ON/UI/UI2/FuntionControlView/Electrical/StbPage.cs
index b96c396..8d323c4 100644
--- a/HDL_ON/UI/UI2/FuntionControlView/Electrical/StbPage.cs
+++ b/HDL_ON/UI/UI2/FuntionControlView/Electrical/StbPage.cs
@@ -46,7 +46,7 @@
#endregion
#region 鍖哄煙鍙橀噺
- Function function;
+ Function device;
Button btnCollection_Out;
Button btnFunctionName_Out;
Button btnFromFloor_Out;
@@ -59,7 +59,7 @@
public StbPage(Function func)
{
bodyView = this;
- function = func;
+ device = func;
}
@@ -89,7 +89,7 @@
TextColor = CSS_Color.FirstLevelTitleColor,
TextAlignment = TextAlignment.CenterLeft,
TextSize = CSS_FontSize.EmphasisFontSize_FirstLevel,
- Text = function.name,
+ Text = device.name,
};
controlView.AddChidren(btnFunctionName);
@@ -102,7 +102,7 @@
TextColor = CSS_Color.PromptingColor1,
TextAlignment = TextAlignment.CenterLeft,
TextSize = CSS_FontSize.PromptFontSize_FirstLevel,
- Text = function.GetRoomListName()
+ Text = device.GetRoomListName()
};
controlView.AddChidren(btnFromFoorAndRoom);
@@ -114,7 +114,7 @@
Height = Application.GetMinRealAverage(40),
SelectedImagePath = "Collection/CollectionIcon.png",
UnSelectedImagePath = "Collection/CollectionGrayIcon.png",
- IsSelected = function.collect
+ IsSelected = device.collect
};
controlView.AddChidren(btnCollection);
//2020-12-16 濡傛灉鏄垚鍛橀殣钘忔敹钘忓姛鑳�
@@ -317,11 +317,14 @@
{
X = Application.GetRealWidth(116),
Y = Application.GetRealHeight(466),
- Width = Application.GetRealWidth(32),
- Height = Application.GetRealWidth(32),
+ Width = Application.GetRealWidth(35),
+ Height = Application.GetRealWidth(35),
UnSelectedImagePath = "FunctionIcon/AC/More.png",
};
controlView.AddChidren(btnMore);
+ btnMore.MouseUpEventHandler = (sender, e) => {
+ LoadDialog_IrMoreView();
+ };
btnPower = new Button()
{
@@ -337,9 +340,7 @@
LoadEventList();
- new TopViewDiv(bodyView, Language.StringByID(StringId.STB)).LoadTopView_FunctionTop(function, actionRefresh);
- DriverLayer.Control.Ins.SendReadCommand(function);
-
+ new TopViewDiv(bodyView, Language.StringByID(StringId.STB)).LoadTopView_FunctionTop(device, actionRefresh);
}
@@ -426,7 +427,7 @@
{
Dictionary<string, string> d = new Dictionary<string, string>();
d.Add($"number_{index}", "");
- Control.Ins.SendWriteCommand(function, d);
+ Control.Ins.SendWriteCommand(device, d);
}
};
btn.MouseDownEventHandler = (sender, e) => {
@@ -449,9 +450,9 @@
//鍥為��鍒锋柊淇℃伅浜嬩欢
actionRefresh = () => {
- btnFunctionName.Text = btnFunctionName_Out.Text = function.name;
- btnFromFloor_Out.Text = btnFromFoorAndRoom.Text = function.GetRoomListName();
- function.UpdataFuncitonInfo();
+ btnFunctionName.Text = btnFunctionName_Out.Text = device.name;
+ btnFromFloor_Out.Text = btnFromFoorAndRoom.Text = device.GetRoomListName();
+ device.UpdataFuncitonInfo();
};
}
@@ -461,8 +462,8 @@
void LoadCollectionEvent()
{
btnCollection.MouseUpEventHandler += (sender, e) => {
- btnCollection.IsSelected = function.collect = btnCollection_Out.IsSelected = !btnCollection.IsSelected;
- function.CollectFunction();
+ btnCollection.IsSelected = device.collect = btnCollection_Out.IsSelected = !btnCollection.IsSelected;
+ device.CollectFunction();
};
}
@@ -477,7 +478,7 @@
{
Dictionary<string, string> d = new Dictionary<string, string>();
d.Add("av_tv", "");
- Control.Ins.SendWriteCommand(function, d);
+ Control.Ins.SendWriteCommand(device, d);
}
};
btnChlPlus.MouseUpEventHandler = (sender, e) =>
@@ -486,7 +487,7 @@
{
Dictionary<string, string> d = new Dictionary<string, string>();
d.Add("ch+", "");
- Control.Ins.SendWriteCommand(function, d);
+ Control.Ins.SendWriteCommand(device, d);
}
};
btnChlReduce.MouseUpEventHandler = (sender, e) =>
@@ -495,7 +496,7 @@
{
Dictionary<string, string> d = new Dictionary<string, string>();
d.Add("ch-", "");
- Control.Ins.SendWriteCommand(function, d);
+ Control.Ins.SendWriteCommand(device, d);
}
};
btnVolPlus.MouseUpEventHandler = (sender, e) =>
@@ -504,7 +505,7 @@
{
Dictionary<string, string> d = new Dictionary<string, string>();
d.Add("volume+", "");
- Control.Ins.SendWriteCommand(function, d);
+ Control.Ins.SendWriteCommand(device, d);
}
};
btnVolReduce.MouseUpEventHandler = (sender, e) =>
@@ -513,7 +514,7 @@
{
Dictionary<string, string> d = new Dictionary<string, string>();
d.Add("volume-", "");
- Control.Ins.SendWriteCommand(function, d);
+ Control.Ins.SendWriteCommand(device, d);
}
};
btnBack.MouseUpEventHandler = (sender, e) =>
@@ -522,7 +523,7 @@
{
Dictionary<string, string> d = new Dictionary<string, string>();
d.Add("return", "");
- Control.Ins.SendWriteCommand(function, d);
+ Control.Ins.SendWriteCommand(device, d);
}
};
@@ -532,7 +533,7 @@
{
Dictionary<string, string> d = new Dictionary<string, string>();
d.Add("menu", "");
- Control.Ins.SendWriteCommand(function, d);
+ Control.Ins.SendWriteCommand(device, d);
}
};
btn123.MouseUpEventHandler = (sender, e) =>
@@ -545,7 +546,7 @@
{
Dictionary<string, string> d = new Dictionary<string, string>();
d.Add("mute", "");
- Control.Ins.SendWriteCommand(function, d);
+ Control.Ins.SendWriteCommand(device, d);
}
};
btnPower.MouseUpEventHandler = (sender, e) =>
@@ -554,7 +555,7 @@
{
Dictionary<string, string> d = new Dictionary<string, string>();
d.Add("on_off", "");
- Control.Ins.SendWriteCommand(function, d);
+ Control.Ins.SendWriteCommand(device, d);
}
};
@@ -581,7 +582,7 @@
{
Dictionary<string, string> d = new Dictionary<string, string>();
d.Add("menu", "");
- Control.Ins.SendWriteCommand(function, d);
+ Control.Ins.SendWriteCommand(device, d);
}
};
btnTopMenuUp.MouseUpEventHandler = (sender, e) => {
@@ -590,7 +591,7 @@
{
Dictionary<string, string> d = new Dictionary<string, string>();
d.Add("up", "");
- Control.Ins.SendWriteCommand(function, d);
+ Control.Ins.SendWriteCommand(device, d);
}
};
btnTopMenuLeft.MouseUpEventHandler = (sender, e) => {
@@ -599,7 +600,7 @@
{
Dictionary<string, string> d = new Dictionary<string, string>();
d.Add("left", "");
- Control.Ins.SendWriteCommand(function, d);
+ Control.Ins.SendWriteCommand(device, d);
}
};
btnTopMenuRight.MouseUpEventHandler = (sender, e) => {
@@ -608,7 +609,7 @@
{
Dictionary<string, string> d = new Dictionary<string, string>();
d.Add("right", "");
- Control.Ins.SendWriteCommand(function, d);
+ Control.Ins.SendWriteCommand(device, d);
}
};
btnTopMenuDown.MouseUpEventHandler = (sender, e) => {
@@ -617,7 +618,7 @@
{
Dictionary<string, string> d = new Dictionary<string, string>();
d.Add("down", "");
- Control.Ins.SendWriteCommand(function, d);
+ Control.Ins.SendWriteCommand(device, d);
}
};
btnOk.MouseUpEventHandler = (sender, e) => {
@@ -626,12 +627,189 @@
{
Dictionary<string, string> d = new Dictionary<string, string>();
d.Add("ok", "");
- Control.Ins.SendWriteCommand(function, d);
+ Control.Ins.SendWriteCommand(device, d);
}
};
}
+
+ /// <summary>
+ /// 鍔犺浇棰濆瀵圭孩澶栨寜閽晫闈�
+ /// </summary>
+ void LoadDialog_IrMoreView()
+ {
+ Dialog dialog = new Dialog();
+
+ var div = new FrameLayout();
+ dialog.AddChidren(div);
+ div.MouseUpEventHandler = (sender, e) => {
+ dialog.Close();
+ };
+
+ var bodyView = new FrameLayout()
+ {
+ Y = Application.GetRealHeight(417),//667
+ Height = Application.GetRealHeight(250),
+ BackgroundColor = CSS_Color.MainBackgroundColor,
+ };
+ div.AddChidren(bodyView);
+
+ var contentView = new VerticalScrolViewLayout()
+ {
+ Y = Application.GetRealHeight(16),
+ Gravity = Gravity.CenterHorizontal,
+ Width = Application.GetRealWidth(296 + 200),
+ Height = Application.GetRealHeight(234),
+ };
+ bodyView.AddChidren(contentView);
+
+
+ var row = new FrameLayout()
+ {
+ Height = Application.GetRealHeight(60),
+ Width = Application.GetRealWidth(296),
+ Gravity = Gravity.CenterHorizontal,
+ };
+ contentView.AddChidren(row);
+
+ int index = 0;
+ List<FunctionAttributes> attrList = new List<FunctionAttributes>();
+ attrList.AddRange(device.attributes);
+ attrList.Add(new FunctionAttributes()
+ {
+ key = "+",
+ });
+
+ foreach (var attr in attrList)
+ {
+ if (attr.key == "up"
+ || attr.key == "down"
+ || attr.key == "right"
+ || attr.key == "left"
+ || attr.key == "zoom+"
+ || attr.key == "zoom-"
+ || attr.key == "volume+"
+ || attr.key == "volume-"
+ || attr.key == "back"
+ || attr.key == "menu"
+ || attr.key == FunctionAttributeKey.OnOff
+ )
+ {
+ continue;
+ }
+ if (index != 0 && index % 3 == 0)
+ {
+ row = new FrameLayout()
+ {
+ Height = Application.GetRealHeight(56),
+ Width = Application.GetRealWidth(296),
+ Gravity = Gravity.CenterHorizontal,
+ };
+ contentView.AddChidren(row);
+ }
+ if (attr.key == "+")
+ {
+ var addView = new FrameLayout()
+ {
+ Gravity = Gravity.CenterVertical,
+ Width = Application.GetRealWidth(88),
+ Height = Application.GetRealHeight(40),
+ Radius = (uint)Application.GetRealHeight(18),
+ BorderColor = CSS_Color.PromptingColor1,
+ BorderWidth = (uint)Application.GetRealWidth(2),
+ };
+
+
+ if (index % 3 == 1)
+ {
+ addView.Gravity = Gravity.Center;
+ }
+ else if (index % 3 == 2)
+ {
+ addView.X = Application.GetRealWidth(208);
+ }
+ row.AddChidren(addView);
+
+ var btnAdd = new Button()
+ {
+ Gravity = Gravity.Center,
+ UnSelectedImagePath = "Public/PlusSignIcon.png",
+ Width = Application.GetRealWidth(32),
+ Height = Application.GetRealWidth(32),
+ };
+ addView.AddChidren(btnAdd);
+
+ btnAdd.MouseUpEventHandler = (sender, e) =>
+ {
+ dialog.Close();
+ Action action = () => {
+ LoadDialog_IrMoreView();
+ };
+ var addButton = new AcControlPage_AddIrButton(action);
+ MainPage.BasePageView.AddChidren(addButton);
+ addButton.Show(device);
+ MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1;
+ };
+
+
+ }
+ else
+ {
+
+ var btn = new Button()
+ {
+ Gravity = Gravity.CenterVertical,
+ Width = Application.GetRealWidth(88),
+ Height = Application.GetRealHeight(40),
+ Radius = (uint)Application.GetRealHeight(18),
+ BorderColor = CSS_Color.PromptingColor1,
+ BorderWidth = (uint)Application.GetRealWidth(2),
+ TextAlignment = TextAlignment.Center,
+ TextSize = CSS_FontSize.TextFontSize,
+ TextColor = CSS_Color.FirstLevelTitleColor,
+ SelectedTextColor = CSS_Color.MainBackgroundColor,
+ SelectedBackgroundColor = CSS_Color.MainColor,
+ };
+ if (attr.value.Count > 0)
+ {
+ btn.Text = attr.value[0];
+ }
+ if (index % 3 == 1)
+ {
+ btn.Gravity = Gravity.Center;
+ }
+ else if (index % 3 == 2)
+ {
+ btn.X = Application.GetRealWidth(208);
+ }
+ row.AddChidren(btn);
+
+ btn.MouseUpEventHandler = (sender, e) =>
+ {
+ Dictionary<string, string> d = new Dictionary<string, string>();
+ d.Add(attr.key, "");
+ Control.Ins.SendWriteCommand(device, d);
+
+ new System.Threading.Thread(() =>
+ {
+ System.Threading.Thread.Sleep(2000);
+ Application.RunOnMainThread(() =>
+ {
+ btn.IsSelected = false;
+ });
+ })
+ { IsBackground = true }.Start();
+ };
+
+ }
+
+ index++;
+ }
+
+ dialog.Show();
+ }
+
}
}
--
Gitblit v1.8.0