From e4ab7ba15864d2adb882646d8e09bd00effa4d1b Mon Sep 17 00:00:00 2001
From: wjc <1243177876@qq.com>
Date: 星期一, 21 八月 2023 17:12:11 +0800
Subject: [PATCH] 2023年08月21日17:12:02
---
HDL_ON/UI/UI2/FuntionControlView/FunctionBaseInfoSetPage.cs | 64 ++
HDL_ON/UI/UI2/FuntionControlView/HisenseTV /Send.cs | 114 +++++
HDL_ON/UI/UI2/FuntionControlView/Aks/CommonView/MenuFramLayout.cs | 59 +-
HDL_ON/UI/UI2/FuntionControlView/HisenseTV /HisenseTvPage.cs | 1082 ++++++++++++++++++++++++++----------------------
HDL_ON/HDL_ON.projitems | 1
5 files changed, 794 insertions(+), 526 deletions(-)
diff --git a/HDL_ON/HDL_ON.projitems b/HDL_ON/HDL_ON.projitems
index 2df66b3..46e0d2e 100644
--- a/HDL_ON/HDL_ON.projitems
+++ b/HDL_ON/HDL_ON.projitems
@@ -592,6 +592,7 @@
<Compile Include="$(MSBuildThisFileDirectory)UI\UI2\FuntionControlView\Aks\Entity\MovieLibraryEntity.cs" />
<Compile Include="$(MSBuildThisFileDirectory)UI\UI2\FuntionControlView\Aks\Entity\MovieLibraryInfoEntity.cs" />
<Compile Include="$(MSBuildThisFileDirectory)UI\UI2\FuntionControlView\HisenseTV \HisenseTvPage.cs" />
+ <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\FuntionControlView\HisenseTV \Send.cs" />
</ItemGroup>
<ItemGroup>
<Folder Include="$(MSBuildThisFileDirectory)Entity\Device\" />
diff --git a/HDL_ON/UI/UI2/FuntionControlView/Aks/CommonView/MenuFramLayout.cs b/HDL_ON/UI/UI2/FuntionControlView/Aks/CommonView/MenuFramLayout.cs
index a969558..0e3bf7b 100644
--- a/HDL_ON/UI/UI2/FuntionControlView/Aks/CommonView/MenuFramLayout.cs
+++ b/HDL_ON/UI/UI2/FuntionControlView/Aks/CommonView/MenuFramLayout.cs
@@ -6,24 +6,22 @@
{
public class MenuFramLayout : BaseFramLayout
{
- private uint UpBackgroundColor = 0x00000000;
- private uint DownBackgroundColor = 0xff454635;
public const int widthFrameLayout = 180;
public const int heightFrameLayout = 180;
public const int cornerValue = 90;
public MenuFramLayout(int width = widthFrameLayout, int height = heightFrameLayout)
{
- this.Width = Application.GetMinRealAverage(width);
- this.Height = Application.GetMinRealAverage(height);
+ this.Width = Application.GetRealWidth(width);
+ this.Height = Application.GetRealWidth(height);
this.Radius = (uint)Application.GetRealHeight(cornerValue);
this.BackgroundColor = MusicColor.ViewColor;
this.Gravity = Gravity.CenterHorizontal;
}
Button btnTop = new Button
{
- Y = Application.GetMinRealAverage(16),
- X = Application.GetMinRealAverage(78),
+ Y = Application.GetRealWidth(16),
+ X = Application.GetRealWidth(78),
Width = Application.GetRealWidth(24),
Height = Application.GetRealHeight(20),
UnSelectedImagePath = "AksIcon/shang.png",
@@ -32,8 +30,8 @@
};
Button btnBottom = new Button
{
- Y = Application.GetMinRealAverage(144),
- X = Application.GetMinRealAverage(78),
+ Y = Application.GetRealWidth(144),
+ X = Application.GetRealWidth(78),
Width = Application.GetRealWidth(24),
Height = Application.GetRealHeight(20),
UnSelectedImagePath = "AksIcon/xia.png",
@@ -42,8 +40,8 @@
};
Button btnLeft = new Button
{
- Y = Application.GetMinRealAverage(78),
- X = Application.GetMinRealAverage(16),
+ Y = Application.GetRealWidth(78),
+ X = Application.GetRealWidth(16),
Width = Application.GetRealWidth(20),
Height = Application.GetRealHeight(24),
UnSelectedImagePath = "AksIcon/zuo.png",
@@ -53,8 +51,8 @@
};
Button btnRight = new Button
{
- Y = Application.GetMinRealAverage(78),
- X = Application.GetMinRealAverage(144),
+ Y = Application.GetRealWidth(78),
+ X = Application.GetRealWidth(144),
Width = Application.GetRealWidth(20),
Height = Application.GetRealHeight(24),
UnSelectedImagePath = "AksIcon/you.png",
@@ -65,10 +63,9 @@
Button btnOkbj = new Button
{
- Y = Application.GetMinRealAverage(52),
- X = Application.GetMinRealAverage(52),
- Width = Application.GetMinRealAverage(76),
- Height = Application.GetMinRealAverage(76),
+ Gravity=Gravity.Center,
+ Width = Application.GetRealWidth(76),
+ Height = Application.GetRealWidth(76),
Radius = (uint)Application.GetRealHeight(38),
BackgroundColor = MusicColor.WhiteColor,
@@ -76,13 +73,13 @@
};
Button btnOk = new Button
{
- Y = Application.GetMinRealAverage(76),
- X = Application.GetMinRealAverage(76),
- Width = Application.GetMinRealAverage(28),
- Height = Application.GetMinRealAverage(28),
+ Gravity = Gravity.Center,
+ Width = Application.GetRealWidth(28),
+ Height = Application.GetRealWidth(28),
Radius = (uint)Application.GetRealHeight(14),
- BackgroundColor = MusicColor.SelectedColor,
- Name= "纭畾"
+ BackgroundColor = 0xff1B2D4D,
+ SelectedBackgroundColor = MusicColor.SelectedColor,
+ Name = "纭畾"
};
public void AddView(FrameLayout layout)
@@ -94,6 +91,7 @@
this.AddChidren(btnOkbj);
this.AddChidren(btnOk);
layout.AddChidren(this);
+ //btnBottom.Y = btnOkbj.Bottom + Application.GetRealWidth(16);
}
@@ -211,7 +209,7 @@
{
EventHandler<MouseEventArgs> UpClick = (sender, e) =>
{
- btnOk.BackgroundColor = MusicColor.SelectedColor;// this.UpBackgroundColor;
+ btnOk.IsSelected = false;
//寮硅捣鏉ヨ繕鍘熻儗鏅鑹�
};
btnOk.MouseUpEventHandler += UpClick;
@@ -219,28 +217,15 @@
EventHandler<MouseEventArgs> DownClick = (sender, e) =>
{
+ btnOk.IsSelected = true;
KeypadEntity keypadEntity = new KeypadEntity();
keypadEntity.name = btnOk.Name;
keypadEntity.keypad = "key_ok";
action?.Invoke(keypadEntity);
//鎸変笅鍘绘敼鍙樿儗鏅鑹�
- btnOk.BackgroundColor = this.DownBackgroundColor;
};
btnOk.MouseDownEventHandler += DownClick;
}
-
- public void SetClickUpBackgroundColor(uint backgroundColor)
- {
- this.UpBackgroundColor = backgroundColor;
-
- }
-
- public void SetClickDownBackgroundColor(uint backgroundColor)
- {
- this.DownBackgroundColor = backgroundColor;
- }
-
-
}
}
diff --git a/HDL_ON/UI/UI2/FuntionControlView/FunctionBaseInfoSetPage.cs b/HDL_ON/UI/UI2/FuntionControlView/FunctionBaseInfoSetPage.cs
index 6622d1c..efdd128 100644
--- a/HDL_ON/UI/UI2/FuntionControlView/FunctionBaseInfoSetPage.cs
+++ b/HDL_ON/UI/UI2/FuntionControlView/FunctionBaseInfoSetPage.cs
@@ -498,6 +498,70 @@
}
#endregion
+
+ #region 鍒犻櫎娴蜂俊鐢佃璁惧
+ if (this.function.spk == SPK.ElectricalTvHisense)
+ {
+ contentView.AddChidren(new Button()
+ {
+ Height = Application.GetRealWidth(8),
+ });
+
+ #region 鍒犻櫎璁惧琛�
+ contentView.AddChidren(new Button()
+ {
+ Height = Application.GetRealHeight(48),
+ });
+
+ var delTextBtn = new Button()
+ {
+ Gravity = Gravity.CenterHorizontal,
+ Width = Application.GetRealWidth(220),
+ Height = Application.GetRealWidth(44),
+ TextAlignment = TextAlignment.Center,
+ TextColor = CSS_Color.WarningColor,
+ TextSize = CSS_FontSize.SubheadingFontSize,
+ TextID = StringId.DeleteDevice,
+ Radius = (uint)Application.GetRealWidth(22),
+ BackgroundColor = CSS_Color.MainBackgroundColor,
+ };
+ contentView.AddChidren(delTextBtn);
+
+ EventHandler<MouseEventArgs> ClickEvent = (sener, e) =>
+ {
+ new HDL_ON.UI.Music.View.TipView().TipBox(-1, StringId.AreYouSureToDeleteThisDevice, () =>
+ {
+ HDL_ON.UI.UI2.FuntionControlView.HisenseTV.Send.Current.DelDevice(this.function.deviceId, (isBool) =>
+ {
+ Application.RunOnMainThread(() =>
+ {
+ if (!isBool)
+ {
+ new Tip()
+ {
+ CloseTime = 1,
+ Text = Language.StringByID(StringId.delFail),
+ Direction = AMPopTipDirection.None,
+ }.Show(bodyView);
+ return;
+ }
+ //鍒犻櫎鏈湴鏂囦欢
+ UI2.FuntionControlView.VideoDoorLock.CommonMethod.Current.DeleteFunction(this.function);
+ this.RemoveFromParent();
+ this.actionDel?.Invoke();
+ });
+
+ });
+
+ });
+ };
+ delTextBtn.MouseUpEventHandler = ClickEvent;
+
+ #endregion
+
+
+ }
+ #endregion
#if stage2
#region 娣诲姞鍒版闈�
var addToDesktopView = new FrameLayout()
diff --git a/HDL_ON/UI/UI2/FuntionControlView/HisenseTV /HisenseTvPage.cs b/HDL_ON/UI/UI2/FuntionControlView/HisenseTV /HisenseTvPage.cs
index 5a91d6c..6b5a1b0 100644
--- a/HDL_ON/UI/UI2/FuntionControlView/HisenseTV /HisenseTvPage.cs
+++ b/HDL_ON/UI/UI2/FuntionControlView/HisenseTV /HisenseTvPage.cs
@@ -1,16 +1,10 @@
锘縰sing Shared;
using System;
using System.Collections.Generic;
-using System.Text;
-using HDL_ON.UI.CSS;
using HDL_ON.Entity;
-using HDL_ON.DriverLayer;
using HDL_ON.UI.Music;
using HDL_ON.UI.UI2.FuntionControlView.VideoDoorLock;
-using HDL_ON.UI.UI2.Intelligence.Automation;
-using System.Linq;
using HDL_ON.UI.UI2.FuntionControlView.Aks.CommonView;
-using HDL_ON.UI.UI2.FuntionControlView.Aks.Entity;
namespace HDL_ON.UI.UI2.FuntionControlView.HisenseTV
{
@@ -38,23 +32,42 @@
/// 澶撮儴甯冨眬
/// </summary>
private TopView topView;
+ BaseFramLayout baseCloseFFL;
+ VerticalScrolViewLayout vv;
/// <summary>
/// 褰撳墠璁惧鍚嶇О
/// </summary>
- private Button btnCurrDeviceName;
+ private Button btnOpenCurrDeviceName;
/// <summary>
/// 鍖哄煙
/// </summary>
- private Button btnCurrDeviceRoom;
-
+ private Button btnOpenCurrDeviceRoom;
/// <summary>
///鏀惰棌鍥炬爣
/// </summary>
- private Button btnCollectIcon;
- /// <summary>
- /// 闂ㄩ攣鐘舵��
- /// </summary>
- private Button btnDoorLockIcon;
+ private Button btnOpenCollectIcon;
+ CustomFrameLayout shouyeFL;
+ CustomFrameLayout kaiguanFL;
+ CustomFrameLayout caidanFL;
+ Button btn_jia;
+ Button btn_jian;
+ CustomButton bofangBtn;
+ CustomButton zantingBtn;
+ CustomButton kuaijinBtn;
+ CustomButton kauituiBtn;
+ CustomButton jingyinBtn;
+ CustomButton shezhiBtn;
+ CustomButton jiechujingyinBtn;
+ CustomButton fanhuiBtn;
+ MenuFramLayout muenFrameLayout;
+ SourceFrameLayout sourceFrameLayout;
+
+
+ Button btnCloseCollectIcon;
+ Button btnCloseCurrDeviceName;
+ Button btnCloseCurrDeviceRoom;
+ Button clickBtn;
+
/// <summary>
/// 琛ㄧず鏉ヨ嚜閭d釜鐣岄潰
/// </summary>
@@ -64,7 +77,6 @@
/// </summary>
public Action action;
#endregion
-
/// <summary>
/// 鏋勯�犲嚱鏁�
@@ -85,7 +97,10 @@
public void Show()
{
//鍒濆鍖朥I
- this.InitUI();
+ this.InitTopUI();
+ this.InitOpenUI();
+ this.InitCloseUI();
+ this.CurrentAssignPage();
//鍒濆鍖栦簨浠�
this.EventListener();
//璇诲彇鏁版嵁
@@ -93,243 +108,6 @@
}
-
- /// <summary>
- /// 鍒濆鍖栫晫闈�
- /// </summary>
- private void InitUI()
- {
- #region ---鐣岄潰甯冨眬---
- this.BackgroundColor = MusicColor.ViewColor;
- this.topView = new TopView();
- this.topView.setBtn.Visible = true;
- this.topView.topNameBtn.TextID = StringId.dianshi;
- this.AddChidren(topView.TopFLayoutView());
-
- var vv = new VerticalScrolViewLayout
- {
- Y = topView.fLayout.Bottom,
- Height = Application.GetRealHeight(H_W.H - H_W.T_Height),
- };
- this.AddChidren(vv);
- var baseFL = new BaseFramLayout();
- vv.AddChidren(baseFL);
-
- var backgroundFl = new FrameLayout
- {
- Y = Application.GetRealHeight(24),
- X = Application.GetRealWidth(24),
- Height = Application.GetRealHeight(682),
- Width = Application.GetRealWidth(327),
- BackgroundImagePath = "HisenseTv/onbj.png",
- Name = "backgroundFl",
- };
- baseFL.AddChidren(backgroundFl);
-
- baseFL.AdjustRealHeight(51);
-
- btnCollectIcon = new Button
- {
- X = Application.GetRealWidth(273),
- Y = Application.GetRealHeight(14),
- Width = Application.GetRealWidth(40),
- Height = Application.GetRealWidth(40),
- UnSelectedImagePath = "MusicIcon/collect.png",
- SelectedImagePath = "MusicIcon/collectSelected.png",
- IsSelected = this.device.collect,
- Name = "collect"
- };
- backgroundFl.AddChidren(btnCollectIcon);
-
- btnCurrDeviceName = new Button
- {
- TextSize = TextSize.Text24,
- TextColor = MusicColor.Text18Color,
- Width = Application.GetRealWidth(160),
- Height = Application.GetRealHeight(33),
- Y = Application.GetRealHeight(16),
- X = Application.GetRealWidth(16),
- Text = this.device.name,
- TextAlignment = TextAlignment.CenterLeft,
- IsBold = true
- };
- backgroundFl.AddChidren(btnCurrDeviceName);
-
-
- btnCurrDeviceRoom = new Button
- {
- TextSize = TextSize.Text12,
- TextColor = MusicColor.MusicNoTxetColor,
- Width = Application.GetRealWidth(160),
- Height = Application.GetRealHeight(17),
- Y = btnCurrDeviceName.Bottom + Application.GetRealHeight(4),
- X = Application.GetRealWidth(16),
- Text = this.device.GetRoomListName(),
- TextAlignment = TextAlignment.CenterLeft,
- };
- backgroundFl.AddChidren(btnCurrDeviceRoom);
-
- int yHeight = btnCurrDeviceRoom.Bottom + Application.GetRealHeight(16);
- var shouyeFL = new CustomFrameLayout();
- backgroundFl.AddChidren(shouyeFL);
- shouyeFL.X = Application.GetRealWidth(24);
- shouyeFL.Y = yHeight;
- shouyeFL.AddImageView();
- shouyeFL.AddTextButtonView();
- shouyeFL.GetImageButton().UnSelectedImagePath = "HisenseTv/shouye.png";
- shouyeFL.GetTextButton().Text = "棣栭〉";
-
-
- var kaiguanFL = new CustomFrameLayout();
- backgroundFl.AddChidren(kaiguanFL);
- kaiguanFL.X = shouyeFL.Right + Application.GetRealWidth(37);
- kaiguanFL.Y = yHeight;
- kaiguanFL.AddImageView();
- kaiguanFL.AddTextButtonView();
- kaiguanFL.GetImageButton().UnSelectedImagePath = "HisenseTv/kaiguan.png";
- kaiguanFL.GetTextButton().Text = "鍏虫満";
-
- var caidanFL = new CustomFrameLayout();
- backgroundFl.AddChidren(caidanFL);
- caidanFL.X = kaiguanFL.Right + Application.GetRealWidth(37);
- caidanFL.Y = yHeight;
- caidanFL.AddImageView();
- caidanFL.AddTextButtonView();
- caidanFL.GetImageButton().UnSelectedImagePath = "HisenseTv/caidan.png";
- caidanFL.GetTextButton().Text = "鑿滃崟";
-
- var yinliangFL = new FrameLayout();
- backgroundFl.AddChidren(yinliangFL);
- yinliangFL.Height = Application.GetRealHeight(200);
- yinliangFL.Width = Application.GetRealWidth(68);
- yinliangFL.Y = shouyeFL.Bottom + Application.GetRealHeight(24);
- yinliangFL.X = shouyeFL.X;
- yinliangFL.BackgroundColor = 0xffF2F3F7;
- yinliangFL.Radius = (uint)Application.GetRealHeight(34);
-
- Button btn_jia = new Button
- {
- Width = Application.GetRealWidth(32),
- Height = Application.GetRealWidth(32),
- UnSelectedImagePath = "HisenseTv/yingliangjia.png",
- Y = Application.GetRealHeight(20),
- Gravity = Gravity.CenterHorizontal,
-
- };
- yinliangFL.AddChidren(btn_jia);
- Button btnText = new Button
- {
- Y = Application.GetRealHeight(90),
- Height = Application.GetRealHeight(20),
- Text = "闊抽噺",
- TextColor = MusicColor.TextColor,
- TextSize = TextSize.Text14,
- Gravity = Gravity.CenterHorizontal,
-
- };
- yinliangFL.AddChidren(btnText);
- Button btn_jian = new Button
- {
- Y = Application.GetRealHeight(148),
- Width = Application.GetRealWidth(32),
- Height = Application.GetRealWidth(32),
- UnSelectedImagePath = "HisenseTv/yingliangjian.png",
- Gravity = Gravity.CenterHorizontal,
-
- };
- yinliangFL.AddChidren(btn_jian);
-
-
- CustomButton bofangBtn = new CustomButton();
- bofangBtn.Text = "鎾斁";
- bofangBtn.Y = shouyeFL.Bottom + Application.GetRealHeight(24);
- bofangBtn.X = yinliangFL.Right + Application.GetRealWidth(37);
- backgroundFl.AddChidren(bofangBtn);
-
-
- CustomButton zantingBtn = new CustomButton();
- zantingBtn.Text = "鏆傚仠";
- zantingBtn.Y = shouyeFL.Bottom + Application.GetRealHeight(24);
- zantingBtn.X = bofangBtn.Right + Application.GetRealWidth(37);
- backgroundFl.AddChidren(zantingBtn);
-
-
- CustomButton kuaijinBtn = new CustomButton();
- kuaijinBtn.Text = "蹇繘";
- kuaijinBtn.Y = bofangBtn.Bottom + Application.GetRealHeight(16);
- kuaijinBtn.X = yinliangFL.Right + Application.GetRealWidth(37);
- backgroundFl.AddChidren(kuaijinBtn);
-
-
- CustomButton kauituiBtn = new CustomButton();
- kauituiBtn.Text = "蹇��";
- kauituiBtn.Y = bofangBtn.Bottom + Application.GetRealHeight(16);
- kauituiBtn.X = kuaijinBtn.Right + Application.GetRealWidth(37);
- backgroundFl.AddChidren(kauituiBtn);
-
-
-
-
- CustomButton jingyinBtn = new CustomButton();
- jingyinBtn.Text = "闈欓煶";
- jingyinBtn.Y = kuaijinBtn.Bottom + Application.GetRealHeight(16);
- jingyinBtn.X = yinliangFL.Right + Application.GetRealWidth(37);
- backgroundFl.AddChidren(jingyinBtn);
-
-
- CustomButton shezhiBtn = new CustomButton();
- shezhiBtn.Text = "璁剧疆";
- shezhiBtn.Y = kuaijinBtn.Bottom + Application.GetRealHeight(16);
- shezhiBtn.X = jingyinBtn.Right + Application.GetRealWidth(37);
- backgroundFl.AddChidren(shezhiBtn);
-
-
-
- CustomButton jiechujingyinBtn = new CustomButton();
- jiechujingyinBtn.Text = "瑙i櫎闈欓煶";
- jiechujingyinBtn.Y = jingyinBtn.Bottom + Application.GetRealHeight(16);
- jiechujingyinBtn.X = yinliangFL.Right + Application.GetRealWidth(37);
- backgroundFl.AddChidren(jiechujingyinBtn);
-
-
- CustomButton fanhuiBtn = new CustomButton();
- fanhuiBtn.Text = "杩斿洖";
- fanhuiBtn.Y = jingyinBtn.Bottom + Application.GetRealHeight(16);
- fanhuiBtn.X = jiechujingyinBtn.Right + Application.GetRealWidth(37);
- backgroundFl.AddChidren(fanhuiBtn);
-
-
- TypeFrameLayout typeFrameLayout = new TypeFrameLayout();
- typeFrameLayout.middLayout.Y = yinliangFL.Bottom + Application.GetRealHeight(32);
- typeFrameLayout.AddView(backgroundFl);
-
-
-
- MuenFrameLayout muenFrameLayout = new MuenFrameLayout ();
- muenFrameLayout.AddView(backgroundFl);
- muenFrameLayout.parentFl.Y = Application.GetRealHeight(482);
- muenFrameLayout.parentFl.X = Application.GetRealWidth(73);
-
-
- typeFrameLayout.SetLfteClickListener((btn) => {
-
-
- });
- typeFrameLayout.SetRightClickListener((btn) => {
-
-
- });
-
- muenFrameLayout.SetLeftClickListener((b) => {
-
- });
-
-
-
- #endregion
-
-
- }
/// <summary>
/// 娉ㄥ唽浜嬩欢
/// </summary>
@@ -355,8 +133,12 @@
////鍒锋柊鏄剧ず
this.btnDeviceName.Text = this.device.name;
this.btnRoomName.Text = this.device.GetRoomListName();
- this.btnCurrDeviceName.Text = this.device.name;
- this.btnCurrDeviceRoom.Text = this.device.GetRoomListName();
+ //
+ this.btnOpenCurrDeviceName.Text = this.device.name;
+ this.btnOpenCurrDeviceRoom.Text = this.device.GetRoomListName();
+ //
+ this.btnCloseCurrDeviceName.Text = this.device.name;
+ this.btnCloseCurrDeviceRoom.Text = this.device.GetRoomListName();
this.CalculatedPosition();//閲嶆柊璁$畻瀹藉害
});
@@ -373,13 +155,67 @@
});
};
//鏀惰棌
- this.btnCollectIcon.MouseUpEventHandler += (sender, e) =>
+ this.btnOpenCollectIcon.MouseUpEventHandler += (sender, e) =>
{
- btnCollectIcon.IsSelected = this.device.collect = !btnCollectIcon.IsSelected;
+ btnOpenCollectIcon.IsSelected = this.device.collect = !btnOpenCollectIcon.IsSelected;
this.device.CollectFunction();
+ };
+
+ //棣栭〉
+ shouyeFL.SetClickListener((fl, btnImage, btnText) => { });
+ //鍏虫満
+ kaiguanFL.SetClickListener((fl, btnImage, btnText) =>
+ {
+ vv.Visible = false;
+ baseCloseFFL.Visible = true;
+ });
+ //鑿滃崟
+ caidanFL.SetClickListener((fl, btnImage, btnText) => { });
+ //闊抽噺+
+ btn_jia.MouseDownEventHandler += (sender, e) => { };
+ //闊抽噺-
+ btn_jian.MouseDownEventHandler += (sender, e) => { };
+ //鎾斁
+ bofangBtn.SetClickListener((btn) => { });
+ //鏆傚仠
+ zantingBtn.SetClickListener((btn) => { });
+ //蹇繘
+ kuaijinBtn.SetClickListener((btn) => { });
+ //蹇��
+ kauituiBtn.SetClickListener((btn) => { });
+ //闈欓煶
+ jingyinBtn.SetClickListener((btn) => { });
+ //璁剧疆
+ shezhiBtn.SetClickListener((btn) => { });
+ //瑙i櫎闈欓煶
+ jiechujingyinBtn.SetClickListener((btn) => { });
+ //杩斿洖
+ fanhuiBtn.SetClickListener((btn) => { });
+ //鎺у埗鑿滃崟
+ muenFrameLayout.SetLeftClickListener((muen) =>
+ {
+
+ });
+ //淇″彿婧�
+ sourceFrameLayout.selectAction += (text) =>
+ {
+
+
};
+ //鏀惰棌(鍏虫満)
+ this.btnCloseCollectIcon.MouseUpEventHandler += (sender, e) =>
+ {
+ btnCloseCollectIcon.IsSelected = this.device.collect = !btnCloseCollectIcon.IsSelected;
+ this.device.CollectFunction();
+ };
+ //寮�鏈�
+ clickBtn.MouseDownEventHandler += (sen, e) =>
+ {
+ vv.Visible = true;
+ baseCloseFFL.Visible = false;
+ };
}
/// <summary>
@@ -406,32 +242,457 @@
}
});
}
+ /// <summary>
+ /// 鍒濆鍖栥�愬紑鏈恒�戠晫闈�
+ /// </summary>
+ private void InitOpenUI()
+ {
+ #region ---鐣岄潰甯冨眬---
+ vv = new VerticalScrolViewLayout
+ {
+ Y = topView.fLayout.Bottom,
+ Height = Application.GetRealHeight(H_W.H - H_W.T_Height),
+ };
+ this.AddChidren(vv);
+ var baseOpenFL = new BaseFramLayout();
+ vv.AddChidren(baseOpenFL);
+ var backgroundOpenFl = new FrameLayout
+ {
+ Y = Application.GetRealHeight(24),
+ X = Application.GetRealWidth(24),
+ Height = Application.GetRealHeight(648),
+ Width = Application.GetRealWidth(327),
+ BackgroundImagePath = "HisenseTv/onbj.png",
+ };
+ baseOpenFL.AddChidren(backgroundOpenFl);
+
+ baseOpenFL.AdjustRealHeight(16);
+
+ btnOpenCollectIcon = new Button
+ {
+ X = Application.GetRealWidth(273),
+ Y = Application.GetRealHeight(14),
+ Width = Application.GetRealWidth(40),
+ Height = Application.GetRealWidth(40),
+ UnSelectedImagePath = "MusicIcon/collect.png",
+ SelectedImagePath = "MusicIcon/collectSelected.png",
+ IsSelected = this.device.collect,
+ };
+ backgroundOpenFl.AddChidren(btnOpenCollectIcon);
+
+ btnOpenCurrDeviceName = new Button
+ {
+ TextSize = TextSize.Text24,
+ TextColor = MusicColor.Text18Color,
+ Width = Application.GetRealWidth(160),
+ Height = Application.GetRealHeight(33),
+ Y = Application.GetRealHeight(16),
+ X = Application.GetRealWidth(16),
+ Text = this.device.name,
+ TextAlignment = TextAlignment.CenterLeft,
+ IsBold = true
+ };
+ backgroundOpenFl.AddChidren(btnOpenCurrDeviceName);
+ btnOpenCurrDeviceRoom = new Button
+ {
+ TextSize = TextSize.Text12,
+ TextColor = MusicColor.MusicNoTxetColor,
+ Width = Application.GetRealWidth(160),
+ Height = Application.GetRealHeight(17),
+ Y = btnOpenCurrDeviceName.Bottom + Application.GetRealHeight(4),
+ X = Application.GetRealWidth(16),
+ Text = this.device.GetRoomListName(),
+ TextAlignment = TextAlignment.CenterLeft,
+ };
+ backgroundOpenFl.AddChidren(btnOpenCurrDeviceRoom);
+
+ int yHeight = btnOpenCurrDeviceRoom.Bottom + Application.GetRealHeight(16);
+ shouyeFL = new CustomFrameLayout();
+ backgroundOpenFl.AddChidren(shouyeFL);
+ shouyeFL.X = Application.GetRealWidth(24);
+ shouyeFL.Y = yHeight;
+ shouyeFL.AddImageView();
+ shouyeFL.AddTextButtonView();
+ shouyeFL.GetImageButton().UnSelectedImagePath = "HisenseTv/shouye.png";
+ shouyeFL.GetTextButton().Text = "棣栭〉";
+
+
+ kaiguanFL = new CustomFrameLayout();
+ backgroundOpenFl.AddChidren(kaiguanFL);
+ kaiguanFL.X = shouyeFL.Right + Application.GetRealWidth(37);
+ kaiguanFL.Y = yHeight;
+ kaiguanFL.AddImageView();
+ kaiguanFL.AddTextButtonView();
+ kaiguanFL.GetImageButton().UnSelectedImagePath = "HisenseTv/kaiguan.png";
+ kaiguanFL.GetTextButton().Text = "鍏虫満";
+
+ caidanFL = new CustomFrameLayout();
+ backgroundOpenFl.AddChidren(caidanFL);
+ caidanFL.X = kaiguanFL.Right + Application.GetRealWidth(37);
+ caidanFL.Y = yHeight;
+ caidanFL.AddImageView();
+ caidanFL.AddTextButtonView();
+ caidanFL.GetImageButton().UnSelectedImagePath = "HisenseTv/caidan.png";
+ caidanFL.GetTextButton().Text = "鑿滃崟";
+
+ var yinliangFL = new FrameLayout();
+ backgroundOpenFl.AddChidren(yinliangFL);
+ yinliangFL.Height = Application.GetRealHeight(200);
+ yinliangFL.Width = Application.GetRealWidth(68);
+ yinliangFL.Y = shouyeFL.Bottom + Application.GetRealHeight(24);
+ yinliangFL.X = shouyeFL.X;
+ yinliangFL.BackgroundColor = 0xffF2F3F7;
+ yinliangFL.Radius = (uint)Application.GetRealHeight(34);
+
+ btn_jia = new Button
+ {
+ Width = Application.GetRealWidth(32),
+ Height = Application.GetRealWidth(32),
+ UnSelectedImagePath = "HisenseTv/yingliangjia.png",
+ Y = Application.GetRealHeight(20),
+ Gravity = Gravity.CenterHorizontal,
+
+ };
+ yinliangFL.AddChidren(btn_jia);
+ Button btnText = new Button
+ {
+ Y = Application.GetRealHeight(90),
+ Height = Application.GetRealHeight(20),
+ Text = "闊抽噺",
+ TextColor = MusicColor.TextColor,
+ TextSize = TextSize.Text14,
+ Gravity = Gravity.CenterHorizontal,
+
+ };
+ yinliangFL.AddChidren(btnText);
+ btn_jian = new Button
+ {
+ Y = Application.GetRealHeight(148),
+ Width = Application.GetRealWidth(32),
+ Height = Application.GetRealWidth(32),
+ UnSelectedImagePath = "HisenseTv/yingliangjian.png",
+ Gravity = Gravity.CenterHorizontal,
+
+ };
+ yinliangFL.AddChidren(btn_jian);
+ btn_jia.MouseUpEventHandler += (sender, e) =>
+ {
+
+
+ };
+ btn_jian.MouseUpEventHandler += (sender, e) =>
+ {
+
+
+ };
+
+ bofangBtn = new CustomButton();
+ bofangBtn.Text = "鎾斁";
+ bofangBtn.Y = shouyeFL.Bottom + Application.GetRealHeight(24);
+ bofangBtn.X = yinliangFL.Right + Application.GetRealWidth(37);
+ backgroundOpenFl.AddChidren(bofangBtn);
+
+
+ zantingBtn = new CustomButton();
+ zantingBtn.Text = "鏆傚仠";
+ zantingBtn.Y = shouyeFL.Bottom + Application.GetRealHeight(24);
+ zantingBtn.X = bofangBtn.Right + Application.GetRealWidth(37);
+ backgroundOpenFl.AddChidren(zantingBtn);
+
+
+ kuaijinBtn = new CustomButton();
+ kuaijinBtn.Text = "蹇繘";
+ kuaijinBtn.Y = bofangBtn.Bottom + Application.GetRealHeight(16);
+ kuaijinBtn.X = yinliangFL.Right + Application.GetRealWidth(37);
+ backgroundOpenFl.AddChidren(kuaijinBtn);
+
+
+ kauituiBtn = new CustomButton();
+ kauituiBtn.Text = "蹇��";
+ kauituiBtn.Y = bofangBtn.Bottom + Application.GetRealHeight(16);
+ kauituiBtn.X = kuaijinBtn.Right + Application.GetRealWidth(37);
+ backgroundOpenFl.AddChidren(kauituiBtn);
+
+
+
+
+ jingyinBtn = new CustomButton();
+ jingyinBtn.Text = "闈欓煶";
+ jingyinBtn.Y = kuaijinBtn.Bottom + Application.GetRealHeight(16);
+ jingyinBtn.X = yinliangFL.Right + Application.GetRealWidth(37);
+ backgroundOpenFl.AddChidren(jingyinBtn);
+
+
+ shezhiBtn = new CustomButton();
+ shezhiBtn.Text = "璁剧疆";
+ shezhiBtn.Y = kuaijinBtn.Bottom + Application.GetRealHeight(16);
+ shezhiBtn.X = jingyinBtn.Right + Application.GetRealWidth(37);
+ backgroundOpenFl.AddChidren(shezhiBtn);
+
+
+
+ jiechujingyinBtn = new CustomButton();
+ jiechujingyinBtn.Text = "瑙i櫎闈欓煶";
+ jiechujingyinBtn.Y = jingyinBtn.Bottom + Application.GetRealHeight(16);
+ jiechujingyinBtn.X = yinliangFL.Right + Application.GetRealWidth(37);
+ backgroundOpenFl.AddChidren(jiechujingyinBtn);
+
+
+ fanhuiBtn = new CustomButton();
+ fanhuiBtn.Text = "杩斿洖";
+ fanhuiBtn.Y = jingyinBtn.Bottom + Application.GetRealHeight(16);
+ fanhuiBtn.X = jiechujingyinBtn.Right + Application.GetRealWidth(37);
+ backgroundOpenFl.AddChidren(fanhuiBtn);
+
+
+ TypeFrameLayout typeFrameLayout = new TypeFrameLayout();
+ typeFrameLayout.middLayout.Y = yinliangFL.Bottom + Application.GetRealHeight(32);
+ typeFrameLayout.AddView(backgroundOpenFl);
+
+ muenFrameLayout = new MenuFramLayout();
+ muenFrameLayout.Y = Application.GetRealHeight(482);
+ muenFrameLayout.AddView(backgroundOpenFl);
+
+ sourceFrameLayout = new SourceFrameLayout();
+ sourceFrameLayout.Y = Application.GetRealHeight(482);
+ backgroundOpenFl.AddChidren(sourceFrameLayout);
+ sourceFrameLayout.LoadSourcePage();
+
+
+
+ muenFrameLayout.Visible = true;
+ sourceFrameLayout.Visible = false;
+ typeFrameLayout.SetLfteClickListener(() =>
+ {
+
+ muenFrameLayout.Visible = true;
+ sourceFrameLayout.Visible = false;
+ });
+ typeFrameLayout.SetRightClickListener(() =>
+ {
+ muenFrameLayout.Visible = false;
+ sourceFrameLayout.Visible = true;
+
+ });
+
+
+
+
+
+ #endregion
+
+ }
+ /// <summary>
+ /// 鍒濆鍖栥�愬叧鏈恒�戠晫闈�
+ /// </summary>
+ private void InitCloseUI()
+ {
+ #region ---鐣岄潰甯冨眬---
+
+ baseCloseFFL = new BaseFramLayout
+ {
+ Y = topView.fLayout.Bottom,
+ Height = Application.GetRealHeight(H_W.H - H_W.T_Height),
+ };
+ this.AddChidren(baseCloseFFL);
+ var backgroundCloseFl = new FrameLayout
+ {
+ Y = Application.GetRealHeight(24),
+ X = Application.GetRealWidth(24),
+ Height = Application.GetRealHeight(526),
+ Width = Application.GetRealWidth(327),
+ BackgroundImagePath = "HisenseTv/offbj.png",
+ };
+ baseCloseFFL.AddChidren(backgroundCloseFl);
+ baseCloseFFL.AdjustRealHeight(16);
+
+ btnCloseCollectIcon = new Button
+ {
+ X = Application.GetRealWidth(273),
+ Y = Application.GetRealHeight(14),
+ Width = Application.GetRealWidth(40),
+ Height = Application.GetRealWidth(40),
+ UnSelectedImagePath = "MusicIcon/collect.png",
+ SelectedImagePath = "MusicIcon/collectSelected.png",
+ IsSelected = this.device.collect,
+ };
+ backgroundCloseFl.AddChidren(btnCloseCollectIcon);
+
+ btnCloseCurrDeviceName = new Button
+ {
+ TextSize = TextSize.Text24,
+ TextColor = MusicColor.Text18Color,
+ Width = Application.GetRealWidth(160),
+ Height = Application.GetRealHeight(33),
+ Y = Application.GetRealHeight(16),
+ X = Application.GetRealWidth(16),
+ Text = this.device.name,
+ TextAlignment = TextAlignment.CenterLeft,
+ IsBold = true
+ };
+ backgroundCloseFl.AddChidren(btnCloseCurrDeviceName);
+
+
+ btnCloseCurrDeviceRoom = new Button
+ {
+ TextSize = TextSize.Text12,
+ TextColor = MusicColor.MusicNoTxetColor,
+ Width = Application.GetRealWidth(160),
+ Height = Application.GetRealHeight(17),
+ Y = btnCloseCurrDeviceName.Bottom + Application.GetRealHeight(4),
+ X = Application.GetRealWidth(16),
+ Text = this.device.GetRoomListName(),
+ TextAlignment = TextAlignment.CenterLeft,
+ };
+ backgroundCloseFl.AddChidren(btnCloseCurrDeviceRoom);
+
+ var btnOffTvBj = new Button
+ {
+ Y = Application.GetRealHeight(108),
+ Height = Application.GetRealWidth(198),
+ Width = Application.GetRealWidth(198),
+ UnSelectedImagePath = "HisenseTv/offtvbj.png",
+ Gravity = Gravity.CenterHorizontal,
+ };
+ backgroundCloseFl.AddChidren(btnOffTvBj);
+
+
+ var btnText = new Button
+ {
+ Y = btnOffTvBj.Bottom + Application.GetRealHeight(20),
+ Width = Application.GetRealWidth(200),
+ Height = Application.GetRealHeight(22),
+ TextSize = TextSize.Text16,
+ TextColor = MusicColor.TextColor,
+ Text = "宸插叧鏈�",
+ TextAlignment = TextAlignment.Center,
+ Gravity = Gravity.CenterHorizontal,
+ Padding = new Padding(0, 16, 0, 16),
+
+ };
+ backgroundCloseFl.AddChidren(btnText);
+
+
+ var offFl = new FrameLayout
+ {
+ Y = btnText.Bottom + Application.GetRealHeight(91),
+ Width = Application.GetRealHeight(32),
+ Height = Application.GetRealWidth(32 + 20),
+ Gravity = Gravity.CenterHorizontal,
+ };
+ backgroundCloseFl.AddChidren(offFl);
+
+ var btnOffIcon = new Button
+ {
+ Height = Application.GetRealWidth(32),
+ Width = Application.GetRealWidth(32),
+ UnSelectedImagePath = "HisenseTv/on.png",
+ Gravity = Gravity.CenterHorizontal,
+ };
+ offFl.AddChidren(btnOffIcon);
+
+ var btnOffText = new Button
+ {
+ Y = btnOffIcon.Bottom + Application.GetRealHeight(4),
+ Height = Application.GetRealHeight(16),
+ TextSize = TextSize.Text12,
+ TextColor = MusicColor.TextCancelColor,
+ Text = "寮�鏈�",
+ TextAlignment = TextAlignment.Center,
+ Gravity = Gravity.CenterHorizontal,
+ Padding = new Padding(0, 2, 0, 2),
+ };
+ offFl.AddChidren(btnOffText);
+
+ clickBtn = new Button
+ {
+ Width = Application.GetRealHeight(32),
+ Height = Application.GetRealWidth(32 + 20),
+ };
+ offFl.AddChidren(clickBtn);
+ #endregion
+
+ }
+ /// <summary>
+ /// 鍒濆鍖栧ご閮�
+ /// </summary>
+ private void InitTopUI()
+ {
+ this.BackgroundColor = MusicColor.ViewColor;
+ this.topView = new TopView();
+ this.topView.setBtn.Visible = true;
+ this.topView.topNameBtn.TextID = StringId.dianshi;
+ this.AddChidren(topView.TopFLayoutView());
+ }
+ /// <summary>
+ /// 鏍规嵁璁惧寮�鍏崇姸鎬佹樉绀烘寚瀹氭樉绀虹晫闈�
+ /// (杩涙潵鐨勬椂鍊欑敤鍒�)
+ /// </summary>
+ /// <returns></returns>
+ private void CurrentAssignPage()
+ {
+
+ if (this.device == null)
+ {
+ vv.Visible = false;
+ baseCloseFFL.Visible = true;
+ return;
+ }
+ if (this.device.GetAttrState("on_off") == "on")
+ {
+ vv.Visible = true;
+ baseCloseFFL.Visible = false;
+ }
+ else
+ {
+ vv.Visible = false;
+ baseCloseFFL.Visible = true;
+ }
+
+ }
/// <summary>
/// 閲嶆柊璁$畻瀹藉害(璁惧鍚嶇О,鎴块棿鎺т欢)
/// </summary>
private void CalculatedPosition()
{
- this.btnCurrDeviceName.Width = this.btnCurrDeviceName.GetTextWidth();
- this.btnCurrDeviceName.Width += 10;
- if (this.btnCurrDeviceName.GetTextWidth() > this.btnCollectIcon.X)
+ //寮�鏈虹姸鎬�
+ this.btnOpenCurrDeviceName.Width = this.btnOpenCurrDeviceName.GetTextWidth();
+ this.btnOpenCurrDeviceName.Width += 10;
+ if (this.btnOpenCurrDeviceName.GetTextWidth() > this.btnOpenCollectIcon.X)
{
//閲嶆柊璁$畻瀹藉害
- this.btnCurrDeviceName.Width = this.btnCollectIcon.X + Application.GetRealWidth(-10);
+ this.btnOpenCurrDeviceName.Width = this.btnOpenCollectIcon.X + Application.GetRealWidth(-10);
}
- this.btnCurrDeviceRoom.Width = this.btnCurrDeviceRoom.GetTextWidth();
- this.btnCurrDeviceRoom.Width += 10;
- if (this.btnCurrDeviceRoom.GetTextWidth() > this.btnCollectIcon.X)
+ this.btnOpenCurrDeviceRoom.Width = this.btnOpenCurrDeviceRoom.GetTextWidth();
+ this.btnOpenCurrDeviceRoom.Width += 10;
+ if (this.btnOpenCurrDeviceRoom.GetTextWidth() > this.btnOpenCollectIcon.X)
{
//閲嶆柊璁$畻瀹藉害
- this.btnCurrDeviceRoom.Width = this.btnCollectIcon.X + Application.GetRealWidth(-20 - 10);
+ this.btnOpenCurrDeviceRoom.Width = this.btnOpenCollectIcon.X + Application.GetRealWidth(-20 - 10);
+ }
+
+
+ //鍏虫満鐘舵��
+ this.btnCloseCurrDeviceName.Width = this.btnCloseCurrDeviceName.GetTextWidth();
+ this.btnCloseCurrDeviceName.Width += 10;
+ if (this.btnCloseCurrDeviceName.GetTextWidth() > this.btnCloseCollectIcon.X)
+ {
+ //閲嶆柊璁$畻瀹藉害
+ this.btnCloseCurrDeviceName.Width = this.btnCloseCollectIcon.X + Application.GetRealWidth(-10);
+ }
+ this.btnCloseCurrDeviceRoom.Width = this.btnCloseCurrDeviceRoom.GetTextWidth();
+ this.btnCloseCurrDeviceRoom.Width += 10;
+ if (this.btnCloseCurrDeviceRoom.GetTextWidth() > this.btnCloseCollectIcon.X)
+ {
+ //閲嶆柊璁$畻瀹藉害
+ this.btnCloseCurrDeviceRoom.Width = this.btnCloseCollectIcon.X + Application.GetRealWidth(-20 - 10);
}
//this.cellFrame.X = this.btnCurrDeviceRoom.Right + Application.GetRealWidth(20);
}
-
-
+
}
/// <summary>
@@ -550,7 +811,7 @@
EventHandler<MouseEventArgs> UpClick = (sender, e) =>
{
- this.BackgroundColor = 0x00000000;
+ this.BackgroundColor = 0xffECEDEE;
};
this.MouseUpEventHandler += UpClick;
@@ -587,7 +848,7 @@
SelectedTextColor = MusicColor.MusicTxet14SelectedColor,
TextSize = TextSize.Text16,
TextID = StringId.kongzhi,
- IsBold=true,
+ IsBold = true,
};
@@ -703,14 +964,12 @@
rightBtnLine.Visible = false;
}
-
/// <summary>
- /// 淇″彿婧愮洃鍚柟娉�
+ /// 鎺у埗鐩戝惉鏂规硶
/// </summary>
- /// <param name="action">鍥炶皟(绗竴涓槸鐖剁被瀵硅薄</param>
- public void SetRightClickListener(Action<Button> action)
+ public void SetLfteClickListener(Action action)
{
- //棰戦亾鐐瑰嚮浜嬩欢
+ //鐐瑰嚮浜嬩欢
clickLeftLayout.MouseDownEventHandler += (sen, e) =>
{
leftBtnTitle.IsSelected = true;
@@ -719,16 +978,16 @@
rightBtnTitle.IsSelected = false;
rightBtnLine.IsSelected = false;
rightBtnLine.Visible = false;
+ action?.Invoke();
};
-
}
/// <summary>
- /// 鎺у埗鐩戝惉鏂规硶
+ /// 淇″彿婧愮洃鍚柟娉�
/// </summary>
- /// <param name="action">鍥炶皟(绗竴涓槸鐖剁被瀵硅薄</param>
- public void SetLfteClickListener(Action<Button> action)
+ public void SetRightClickListener(Action action)
{
- //鎺у埗鐐瑰嚮浜嬩欢
+
+ //鐐瑰嚮浜嬩欢
clickRightLayout.MouseDownEventHandler += (sen, e) =>
{
leftBtnTitle.IsSelected = false;
@@ -737,239 +996,84 @@
rightBtnTitle.IsSelected = true;
rightBtnLine.IsSelected = true;
rightBtnLine.Visible = true;
+ action?.Invoke();
+
};
+
}
-
-
}
/// <summary>
- /// 鑿滃崟瀹瑰櫒
+ /// 淇″彿婧愬鍣�
/// </summary>
- class MuenFrameLayout
+ class SourceFrameLayout : FrameLayout
{
+ public const int widthFrameLayout = 375;
+ public const int heightFrameLayout = 146;
+ public const int interval = 37;//琛屼腑鐨勫垪闂撮殧鍊�
- public FrameLayout parentFl = new FrameLayout
+ public Action<string> selectAction;
+
+ public SourceFrameLayout(int width = widthFrameLayout, int height = heightFrameLayout)
{
- Width = Application.GetRealWidth(180),
- Height = Application.GetRealWidth(180),
- Radius = (uint)Application.GetRealHeight(90),
- BackgroundColor= 0xffF2F3F7,
-
- };
-
- Button btnTop = new Button
- {
- Y = Application.GetRealWidth(16),
- X = Application.GetRealWidth(78),
- Width = Application.GetRealWidth(24),
- Height = Application.GetRealHeight(20),
- UnSelectedImagePath = "AksIcon/shang.png",
- SelectedImagePath = "AksIcon/shang_selected.png",
- Name = "涓�",
- };
- Button btnBottom = new Button
- {
- Y = Application.GetRealWidth(144),
- X = Application.GetRealWidth(78),
- Width = Application.GetRealWidth(24),
- Height = Application.GetRealHeight(20),
- UnSelectedImagePath = "AksIcon/xia.png",
- SelectedImagePath = "AksIcon/xia_selected.png",
- Name = "涓�",
- };
- Button btnLeft = new Button
- {
- Y = Application.GetRealWidth(78),
- X = Application.GetRealWidth(16),
- Width = Application.GetRealWidth(20),
- Height = Application.GetRealHeight(24),
- UnSelectedImagePath = "AksIcon/zuo.png",
- SelectedImagePath = "AksIcon/zuo_selected.png",
- Name = "宸�",
-
- };
- Button btnRight = new Button
- {
- Y = Application.GetRealWidth(78),
- X = Application.GetRealWidth(144),
- Width = Application.GetRealWidth(20),
- Height = Application.GetRealHeight(24),
- UnSelectedImagePath = "AksIcon/you.png",
- SelectedImagePath = "AksIcon/you_selected.png",
- Name = "鍙�",
-
- };
-
- Button btnOkbj = new Button
- {
- //Y = Application.GetRealWidth(52),
- //X = Application.GetRealWidth(52),
- Width = Application.GetRealWidth(76),
- Height = Application.GetRealWidth(76),
- Radius = (uint)Application.GetRealHeight(38),
- Gravity=Gravity.Center,
- BackgroundColor = MusicColor.WhiteColor,
-
-
- };
- Button btnOk = new Button
- {
- //Y = Application.GetRealWidth(76),
- //X = Application.GetRealWidth(76),
- Gravity = Gravity.Center,
- Width = Application.GetRealWidth(28),
- Height = Application.GetRealWidth(28),
- Radius = (uint)Application.GetRealHeight(14),
- BackgroundColor = MusicColor.SelectedColor,
- Name = "纭畾"
- };
-
- public void AddView(FrameLayout layout)
- {
- layout.AddChidren(parentFl);
- parentFl.AddChidren(btnTop);
- parentFl.AddChidren(btnBottom);
- parentFl.AddChidren(btnLeft);
- parentFl.AddChidren(btnRight);
- parentFl.AddChidren(btnOkbj);
- parentFl.AddChidren(btnOk);
-
-
+ this.Width = Application.GetRealWidth(width);
+ this.Height = Application.GetRealHeight(height);
}
/// <summary>
- /// 涓�
+ /// 鍔ㄦ�佸姞杞藉浘鐗囩晫闈�
/// </summary>
- /// <param name="action"></param>
- public void SetTopClickListener(Action<KeypadEntity> action)
+ public void LoadSourcePage()
{
- EventHandler<MouseEventArgs> UpClick = (sender, e) =>
+ var mList = GetList();
+ int currnetheightValue = 0;
+ int currnetWidthValue = 0;
+ int heightMaxValue = 38;
+ int widthMaxValue = 68;
+ //鑾峰彇鐩稿涓�涓含搴﹀��
+ int widthDimensionValue = this.Width - Application.GetRealWidth(24) - Application.GetRealWidth(24) - Application.GetRealHeight(widthMaxValue / 2);
+ for (int i = 0; i < mList.Count; i++)
{
- btnTop.IsSelected = false;
- //寮硅捣鏉ヨ繕鍘熻儗鏅鑹�
- };
- btnTop.MouseUpEventHandler += UpClick;
+ var source = mList[i];
+ CustomButton button = new CustomButton();
+ this.AddChidren(button);
+ button.Tag = source;
+ button.Y = Application.GetRealHeight(currnetheightValue);
+ button.X = Application.GetRealWidth(24) + Application.GetRealWidth(currnetWidthValue);
+ button.Text = source;
+ currnetWidthValue += (widthMaxValue + 37);//37鏄殧闂村��
+ if (widthDimensionValue < Application.GetRealWidth(currnetWidthValue))
+ {
+ currnetheightValue += (heightMaxValue + 16);//16鏄殧闂村��
+ currnetWidthValue = 0;
+ }
+ button.SetClickListener((btn) =>
+ {
+ // MovieLibrary movieLibrary = new MovieLibrary();
+ selectAction?.Invoke(button.Text);
+ });
+ //if (CurrnetSelectIndex != -1 && CurrnetSelectIndex == i)
+ //{
+ // selectImageAction?.Invoke((int)imageFram.Tag);
+ //}
+ }
- EventHandler<MouseEventArgs> DownClick = (sender, e) =>
- {
- //鎸変笅鍘绘敼鍙樿儗鏅鑹�
- btnTop.IsSelected = true;
- KeypadEntity keypadEntity = new KeypadEntity();
- keypadEntity.name = btnTop.Name;
- keypadEntity.keypad = "key_up";
- action?.Invoke(keypadEntity);
- };
- btnTop.MouseDownEventHandler += DownClick;
}
-
- /// <summary>
- /// 涓�
- /// </summary>
- /// <param name="action"></param>
- public void SetBottomClickListener(Action<KeypadEntity> action)
+ private List<string> GetList()
{
- EventHandler<MouseEventArgs> UpClick = (sender, e) =>
+ return new List<string>
{
- btnBottom.IsSelected = false;
-
-
- //寮硅捣鏉ヨ繕鍘熻儗鏅鑹�
+ "HDML 1",
+ "HDML 2",
+ "HDML 3",
+ "HDML 4",
+ "Live TV",
+ "PS",
+ "AV",
};
- btnBottom.MouseUpEventHandler += UpClick;
-
-
- EventHandler<MouseEventArgs> DownClick = (sender, e) =>
- {
- btnBottom.IsSelected = true;
- KeypadEntity keypadEntity = new KeypadEntity();
- keypadEntity.name = btnBottom.Name;
- keypadEntity.keypad = "key_down";
- action?.Invoke(keypadEntity);
- //鎸変笅鍘绘敼鍙樿儗鏅鑹�
- };
- btnBottom.MouseDownEventHandler += DownClick;
}
- /// <summary>
- /// 宸�
- /// </summary>
- /// <param name="action"></param>
- public void SetLeftClickListener(Action<KeypadEntity> action)
- {
- EventHandler<MouseEventArgs> UpClick = (sender, e) =>
- {
- btnLeft.IsSelected = false;
- //寮硅捣鏉ヨ繕鍘熻儗鏅鑹�
- };
- btnLeft.MouseUpEventHandler += UpClick;
-
-
- EventHandler<MouseEventArgs> DownClick = (sender, e) =>
- {
- btnLeft.IsSelected = true;
- KeypadEntity keypadEntity = new KeypadEntity();
- keypadEntity.name = btnLeft.Name;
- keypadEntity.keypad = "key_left";
- action?.Invoke(keypadEntity);
- //鎸変笅鍘绘敼鍙樿儗鏅鑹�
- };
- btnLeft.MouseDownEventHandler += DownClick;
- }
- /// <summary>
- /// 鍙�
- /// </summary>
- /// <param name="action"></param>
- public void SetRightClickListener(Action<KeypadEntity> action)
- {
- EventHandler<MouseEventArgs> UpClick = (sender, e) =>
- {
- btnRight.IsSelected = false;
- //寮硅捣鏉ヨ繕鍘熻儗鏅鑹�
- };
- btnRight.MouseUpEventHandler += UpClick;
-
-
- EventHandler<MouseEventArgs> DownClick = (sender, e) =>
- {
- //鎸変笅鍘绘敼鍙樿儗鏅鑹�
- btnRight.IsSelected = true;
- KeypadEntity keypadEntity = new KeypadEntity();
- keypadEntity.name = btnRight.Name;
- keypadEntity.keypad = "key_right";
- action?.Invoke(keypadEntity);
- };
- btnRight.MouseDownEventHandler += DownClick;
- }
-
-
-
- /// <summary>
- /// ok
- /// </summary>
- /// <param name="action"></param>
- public void SetOkClickListener(Action<KeypadEntity> action)
- {
- EventHandler<MouseEventArgs> UpClick = (sender, e) =>
- {
- btnOk.BackgroundColor = MusicColor.SelectedColor;// this.UpBackgroundColor;
- //寮硅捣鏉ヨ繕鍘熻儗鏅鑹�
- };
- btnOk.MouseUpEventHandler += UpClick;
-
-
- EventHandler<MouseEventArgs> DownClick = (sender, e) =>
- {
- KeypadEntity keypadEntity = new KeypadEntity();
- keypadEntity.name = btnOk.Name;
- keypadEntity.keypad = "key_ok";
- action?.Invoke(keypadEntity);
- btnOk.BackgroundColor = 0xffF2F3F7;
- };
- btnOk.MouseDownEventHandler += DownClick;
- }
-
}
diff --git a/HDL_ON/UI/UI2/FuntionControlView/HisenseTV /Send.cs b/HDL_ON/UI/UI2/FuntionControlView/HisenseTV /Send.cs
new file mode 100644
index 0000000..0e5cd5a
--- /dev/null
+++ b/HDL_ON/UI/UI2/FuntionControlView/HisenseTV /Send.cs
@@ -0,0 +1,114 @@
+锘縰sing System;
+using System.Collections.Generic;
+using HDL_ON.DAL.Server;
+using HDL_ON.Entity;
+using HDL_ON.UI.UI2.FuntionControlView.VideoDoorLock;
+using Shared;
+using static HDL_ON.UI.UI2.FuntionControlView.VideoDoorLock.CommonMethod;
+
+namespace HDL_ON.UI.UI2.FuntionControlView.HisenseTV
+{
+ public class Send
+ {
+ private static Send sendMethod = null;
+ /// <summary>
+ /// 鑾峰彇瀵硅薄
+ /// </summary>
+ public static Send Current
+ {
+ get
+ {
+ if (sendMethod == null)
+ {
+ sendMethod = new Send();
+ }
+
+ return sendMethod;
+
+ }
+
+ }
+
+ /// <summary>
+ ///鍒犻櫎璁惧
+ /// </summary>
+ /// <param name="deviceId">璁惧id</param>
+ /// <param name="action">鎴愬姛杩斿洖true</param>
+ /// <param name="tipType">鏄惁闇�瑕佹彁绀�,榛樿鎻愮ず</param>
+ public bool DelDevice(string deviceId,Action<bool>action, TipType tipType = TipType.flicker)
+ {
+ Dictionary<string, object> d = new Dictionary<string, object>();
+ d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id);
+ d.Add("deviceId", deviceId);//璁惧id
+ var responsePackNew = UI.Music.SendMethod.Current.RequestServerhomeId(d, NewAPI.Api_Post_Aks_KeypadExecute, "鍒犻櫎娴蜂俊鐢佃");
+ if (!this.DataChecking(responsePackNew, tipType))
+ {
+ return false;
+ }
+ return true;
+ }
+
+
+ /// <summary>
+ ///璇锋眰鏈嶅姟鍣紙涓庝綇瀹呮湁鍏�:渚嬪锛沨omeId锛�
+ /// </summary>
+ /// <param name="o">鍙戦�佹暟鎹�</param>
+ /// <param name="api_Url">璇锋眰鍦板潃(涓嶆槸缁濆鍦板潃)</param>
+ /// <param name="tag">鏍囪->鎻忚堪鎺ュ彛(鑷畾涔�)</param>
+ /// <returns></returns>
+ public ResponsePackNew RequestServerhomeId(object o, string api_Url, string tag, int mTimeout = 3)
+ {
+ Log($"{DateTime.Now}->鍙戦��->{tag}", api_Url, o.ToString());
+ var requestJson = HttpUtil.GetSignRequestJson(o);
+ var r = HttpUtil.RequestHttpsPostFroHome(api_Url, requestJson, mTimeout);
+ Log($"{DateTime.Now}->鍥炲->{tag}", "", Newtonsoft.Json.JsonConvert.SerializeObject(r));
+ return r;
+
+ }
+
+
+ /// <summary>
+ /// <summary>
+ /// 妫�楠屾暟鎹洖澶嶆垚鍔熸垨鑰呭け璐�
+ /// </summary>
+ /// <param name="responsePackNew">鍥炲鏁版嵁瀵硅薄</param>
+ /// <param name="tipType">鏄惁闇�瑕佹彁绀�</param>
+ /// <returns></returns>
+ private bool DataChecking(ResponsePackNew responsePackNew, TipType tipType)
+ {
+ if (responsePackNew.Data == null || responsePackNew.Code != "0" || responsePackNew.Data.ToString() == "")
+ {
+ if (TipType.flicker == tipType)
+ {
+ if (responsePackNew == null)
+ {
+ responsePackNew = new ResponsePackNew { message = "娌″洖澶�,璇风‘璁ょ綉缁滄槸鍚︽甯�.", Code = "-1", };
+ }
+ Application.RunOnMainThread(() =>
+ {
+ //new Tip()
+ //{
+ // CloseTime = 1,
+ // Text = responsePackNew.message + "(" + responsePackNew.Code + ")",
+ // Direction = AMPopTipDirection.None,
+ //}.Show(MainPage.BasePageView.GetChildren(MainPage.BasePageView.ChildrenCount - 1));
+ CommonMethod.Current.ShowTip(responsePackNew.message + "(" + responsePackNew.Code + ")", 3);
+ });
+ }
+ return false;
+ }
+ return true;
+ }
+ /// <summary>
+ /// 鎵撳嵃鏃ュ織
+ /// </summary>
+ /// <param name="tag">鎵撳嵃鏍囪</param>
+ /// <param name="content">鎵撳嵃鍐呭</param>
+ public void Log(string tag, string url, string content)
+ {
+#if DEBUG
+ Console.WriteLine(tag + $"\r\n{url}\r\n{content}");
+#endif
+ }
+ }
+}
--
Gitblit v1.8.0