From f9181a9c8125136f597add7c30cb2ff508d54ba7 Mon Sep 17 00:00:00 2001
From: mac <user@users-MacBook-Pro.local>
Date: 星期四, 25 七月 2024 17:34:32 +0800
Subject: [PATCH] 2024年07月25日17:33:40

---
 HDL_ON/UI/UI2/FuntionControlView/HisenseTV /HisenseTvPage.cs |  453 ++++++++++++++++----------------------------------------
 1 files changed, 132 insertions(+), 321 deletions(-)

diff --git a/HDL_ON/UI/UI2/FuntionControlView/HisenseTV /HisenseTvPage.cs b/HDL_ON/UI/UI2/FuntionControlView/HisenseTV /HisenseTvPage.cs
index e939fda..d0a93d8 100644
--- a/HDL_ON/UI/UI2/FuntionControlView/HisenseTV /HisenseTvPage.cs
+++ b/HDL_ON/UI/UI2/FuntionControlView/HisenseTV /HisenseTvPage.cs
@@ -32,12 +32,13 @@
         /// 涓婁竴绾х晫闈㈢殑鏀惰棌鎺т欢
         /// </summary>
         private Button btnCollectionIcon;
-        
         /// <summary>
         /// 澶撮儴甯冨眬
         /// </summary>
         private TopView topView;
-        BaseFramLayout baseCloseFFL;
+        /// <summary>
+        ///涓儴甯冨眬
+        /// </summary>
         VerticalScrolViewLayout vv;
         /// <summary>
         /// 褰撳墠璁惧鍚嶇О
@@ -52,10 +53,11 @@
         /// </summary>
         private Button btnOpenCollectIcon;
         CustomFrameLayout shouyeFL;
-        CustomFrameLayout kaiguanFL;
-        CustomFrameLayout caidanFL;
+        CustomFrameLayout kaijiFL;
+        CustomFrameLayout guanFL;
         Button btn_jia;
         Button btn_jian;
+        CustomButton caidanBtn;
         CustomButton bofangBtn;
         CustomButton zantingBtn;
         CustomButton kuaijinBtn;
@@ -66,12 +68,6 @@
         CustomButton fanhuiBtn;
         MenuFramLayout muenFrameLayout;
         SourceFrameLayout sourceFrameLayout;
-
-
-        Button btnCloseCollectIcon;
-        Button btnCloseCurrDeviceName;
-        Button btnCloseCurrDeviceRoom;
-        Button clickBtn;
 
         /// <summary>
         /// 琛ㄧず鏉ヨ嚜閭d釜鐣岄潰
@@ -106,8 +102,6 @@
             //鍒濆鍖朥I
             this.InitTopUI();
             this.InitOpenUI();
-            this.InitCloseUI();
-            this.CurrentAssignPage();
             //鍒濆鍖栦簨浠�
             this.EventListener();
             //璇诲彇鏁版嵁
@@ -143,9 +137,6 @@
                         //
                         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();//閲嶆柊璁$畻瀹藉害
 
                     });
@@ -166,7 +157,6 @@
             {
                 btnOpenCollectIcon.IsSelected = this.device.collect = !btnOpenCollectIcon.IsSelected;
                 this.device.CollectFunction();
-                btnCloseCollectIcon.IsSelected = btnOpenCollectIcon.IsSelected;
                 this.btnCollectionIcon.IsSelected = btnOpenCollectIcon.IsSelected;
             };
 
@@ -175,42 +165,37 @@
             {
                 ControlCommand(HisenseTVFunctionalAttributeConstant.home_page, "");
             });
-            //鍏虫満
-            kaiguanFL.SetClickListener((fl, btnImage, btnText) =>
+            //寮�鏈�
+            kaijiFL.SetClickListener((fl, btnImage, btnText) =>
             {
-                ControlCommand(HisenseTVFunctionalAttributeConstant.on_off, "off", (isBool) =>
-                {
-                    if (isBool)
-                    {
-                        CommonMethod.Current.MainThread(() =>
-                        {
-                            vv.Visible = false;
-                            baseCloseFFL.Visible = true;
-                        });
-                    }
-                    else
-                    {
-                        //鎻愮ず:鍏虫満澶辫触;
-                    }
-                });
+                ControlCommand(HisenseTVFunctionalAttributeConstant.wol, "on");
+
             });
-            //鑿滃崟
-            caidanFL.SetClickListener((fl, btnImage, btnText) =>
+            //鍏虫満
+            guanFL.SetClickListener((fl, btnImage, btnText) =>
             {
-                ControlCommand(HisenseTVFunctionalAttributeConstant.operation, "11");
+                ControlCommand(HisenseTVFunctionalAttributeConstant.on_off, "off");
 
             });
             //闊抽噺+
-            btn_jia.MouseDownEventHandler += (sender, e) =>
+            btn_jia.MouseUpEventHandler += (sender, e) =>
             {
                 ControlCommand(HisenseTVFunctionalAttributeConstant.volume_add, "");
+                this.SetButtonIsSelected(btn_jia);
 
             };
             //闊抽噺-
-            btn_jian.MouseDownEventHandler += (sender, e) =>
+            btn_jian.MouseUpEventHandler += (sender, e) =>
             {
                 ControlCommand(HisenseTVFunctionalAttributeConstant.volume_subtract, "");
+                this.SetButtonIsSelected(btn_jian);
             };
+            //鑿滃崟
+            caidanBtn.SetClickListener((btn) =>
+             {
+                 ControlCommand(HisenseTVFunctionalAttributeConstant.operation, "11");
+
+             });
             //鎾斁
             bofangBtn.SetClickListener((btn) =>
             {
@@ -288,40 +273,12 @@
 
             });
             //淇″彿婧�
-            sourceFrameLayout.selectAction += (text) =>
+            sourceFrameLayout.selectAction += (key) =>
             {
-                string value = text.Replace(" ", "_");
+                var p = new UI2.Intelligence.Automation.PublicInterface();
+                var dic = p.GetHisenseSignalSourceDic();
+                string value = p.GetValue(dic, key);
                 ControlCommand(HisenseTVFunctionalAttributeConstant.signal, value);
-            };
-
-
-            //鏀惰棌(鍏虫満)
-            this.btnCloseCollectIcon.MouseUpEventHandler += (sender, e) =>
-            {
-                btnCloseCollectIcon.IsSelected = this.device.collect = !btnCloseCollectIcon.IsSelected;
-                this.device.CollectFunction();
-                btnOpenCollectIcon.IsSelected = btnCloseCollectIcon.IsSelected;
-                this.btnCollectionIcon.IsSelected = btnCloseCollectIcon.IsSelected;
-            };
-            //寮�鏈�
-            clickBtn.MouseDownEventHandler += (sen, e) =>
-            {
-                ControlCommand(HisenseTVFunctionalAttributeConstant.on_off, "on", (isBool) =>
-                {
-                    if (isBool)
-                    {
-                        CommonMethod.Current.MainThread(() =>
-                        {
-                            vv.Visible = true;
-                            baseCloseFFL.Visible = false;
-                        });
-                    }
-                    else
-                    {
-                        //鎻愮ず:寮�鏈哄け璐�;
-                    }
-                });
-
             };
 
         }
@@ -335,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);
@@ -346,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
@@ -385,7 +375,7 @@
             {
                 Y = Application.GetRealHeight(24),
                 X = Application.GetRealWidth(24),
-                Height = Application.GetRealHeight(648),
+                Height = Application.GetRealHeight(648-60),
                 Width = Application.GetRealWidth(327),
                 BackgroundImagePath = "HisenseTv/onbj.png",
             };
@@ -432,7 +422,7 @@
                 TextAlignment = TextAlignment.CenterLeft,
             };
             backgroundOpenFl.AddChidren(btnOpenCurrDeviceRoom);
-
+     
             int yHeight = btnOpenCurrDeviceRoom.Bottom + Application.GetRealHeight(16);
             shouyeFL = new CustomFrameLayout();
             backgroundOpenFl.AddChidren(shouyeFL);
@@ -441,49 +431,54 @@
             shouyeFL.AddImageView();
             shouyeFL.AddTextButtonView();
             shouyeFL.GetImageButton().UnSelectedImagePath = "HisenseTv/shouye.png";
+            shouyeFL.GetImageButton().SelectedImagePath = "HisenseTv/shouyeSelected.png";
             shouyeFL.GetTextButton().TextID = StringId.shouye;
 
 
-            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().TextID = StringId.guanji;
+            kaijiFL = new CustomFrameLayout();
+            backgroundOpenFl.AddChidren(kaijiFL);
+            kaijiFL.X = shouyeFL.Right + Application.GetRealWidth(37);
+            kaijiFL.Y = yHeight;
+            kaijiFL.AddImageView();
+            kaijiFL.AddTextButtonView();
+            kaijiFL.GetImageButton().UnSelectedImagePath = "HisenseTv/kai.png";
+            kaijiFL.GetImageButton().SelectedImagePath = "HisenseTv/kaiguanSelected.png";
+            kaijiFL.GetTextButton().TextID = StringId.kaiji;
 
-            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().TextID = StringId.caidan;
+            guanFL = new CustomFrameLayout();
+            backgroundOpenFl.AddChidren(guanFL);
+            guanFL.X = kaijiFL.Right + Application.GetRealWidth(37);
+            guanFL.Y = yHeight;
+            guanFL.AddImageView();
+            guanFL.AddTextButtonView();
+            guanFL.GetImageButton().UnSelectedImagePath = "HisenseTv/guan.png";
+            guanFL.GetImageButton().SelectedImagePath = "HisenseTv/kaiguanSelected.png";
+            //guanFL.GetImageButton().UnSelectedImagePath = "HisenseTv/caidan.png";
+            guanFL.GetTextButton().TextID = StringId.guanji;
 
             var yinliangFL = new FrameLayout();
             backgroundOpenFl.AddChidren(yinliangFL);
-            yinliangFL.Height = Application.GetRealHeight(200);
+            yinliangFL.Height = Application.GetRealHeight(146-16);
             yinliangFL.Width = Application.GetRealWidth(68);
-            yinliangFL.Y = shouyeFL.Bottom + Application.GetRealHeight(24);
+            yinliangFL.Y = Application.GetRealHeight(260-8-20);
             yinliangFL.X = shouyeFL.X;
-            yinliangFL.BackgroundColor = 0xffF2F3F7;
-            yinliangFL.Radius = (uint)Application.GetRealHeight(34);
+            yinliangFL.BackgroundColor = 0xFFF2F3F7;
+            yinliangFL.Radius = (uint)Application.GetRealWidth(34);
 
             btn_jia = new Button
             {
                 Width = Application.GetRealWidth(32),
                 Height = Application.GetRealWidth(32),
                 UnSelectedImagePath = "HisenseTv/yingliangjia.png",
-                Y = Application.GetRealHeight(20),
+                SelectedImagePath = "HisenseTv/yingliangjiaSelected.png",
+                Y = Application.GetRealHeight(16),
                 Gravity = Gravity.CenterHorizontal,
 
             };
             yinliangFL.AddChidren(btn_jia);
             Button btnText = new Button
             {
-                Y = Application.GetRealHeight(90),
+                Y = Application.GetRealHeight(63-8),
                 Height = Application.GetRealHeight(20),
                 //Text = "闊抽噺",
                 TextID = StringId.yinliang,
@@ -495,49 +490,47 @@
             yinliangFL.AddChidren(btnText);
             btn_jian = new Button
             {
-                Y = Application.GetRealHeight(148),
+                Y = Application.GetRealHeight(98-8),
                 Width = Application.GetRealWidth(32),
                 Height = Application.GetRealWidth(32),
                 UnSelectedImagePath = "HisenseTv/yingliangjian.png",
+                SelectedImagePath = "HisenseTv/yingliangjianSelected.png",
                 Gravity = Gravity.CenterHorizontal,
 
             };
             yinliangFL.AddChidren(btn_jian);
-            btn_jia.MouseUpEventHandler += (sender, e) =>
-            {
 
-
-            };
-            btn_jian.MouseUpEventHandler += (sender, e) =>
-            {
-
-
-            };
+            int bottomValue= 4;
+            caidanBtn = new CustomButton();
+            caidanBtn.TextID = StringId.caidan;
+            caidanBtn.Y = shouyeFL.Bottom + Application.GetRealHeight(bottomValue);
+            caidanBtn.X = shouyeFL.X;
+            backgroundOpenFl.AddChidren(caidanBtn);
 
             bofangBtn = new CustomButton();
             bofangBtn.TextID = StringId.bofang;
-            bofangBtn.Y = shouyeFL.Bottom + Application.GetRealHeight(24);
+            bofangBtn.Y = shouyeFL.Bottom + Application.GetRealHeight(bottomValue);
             bofangBtn.X = yinliangFL.Right + Application.GetRealWidth(37);
             backgroundOpenFl.AddChidren(bofangBtn);
 
-
+      
             zantingBtn = new CustomButton();
             zantingBtn.TextID = StringId.zanting;
-            zantingBtn.Y = shouyeFL.Bottom + Application.GetRealHeight(24);
+            zantingBtn.Y = shouyeFL.Bottom + Application.GetRealHeight(bottomValue);
             zantingBtn.X = bofangBtn.Right + Application.GetRealWidth(37);
             backgroundOpenFl.AddChidren(zantingBtn);
 
-
+            int bottomValue1 = 8;
             kuaijinBtn = new CustomButton();
             kuaijinBtn.TextID = StringId.kuaijin;
-            kuaijinBtn.Y = bofangBtn.Bottom + Application.GetRealHeight(16);
+            kuaijinBtn.Y = bofangBtn.Bottom + Application.GetRealHeight(bottomValue1);
             kuaijinBtn.X = yinliangFL.Right + Application.GetRealWidth(37);
             backgroundOpenFl.AddChidren(kuaijinBtn);
 
 
             kauituiBtn = new CustomButton();
             kauituiBtn.TextID = StringId.kuaitui;
-            kauituiBtn.Y = bofangBtn.Bottom + Application.GetRealHeight(16);
+            kauituiBtn.Y = bofangBtn.Bottom + Application.GetRealHeight(bottomValue1);
             kauituiBtn.X = kuaijinBtn.Right + Application.GetRealWidth(37);
             backgroundOpenFl.AddChidren(kauituiBtn);
 
@@ -546,14 +539,14 @@
 
             jingyinBtn = new CustomButton();
             jingyinBtn.TextID = StringId.jingyin;
-            jingyinBtn.Y = kuaijinBtn.Bottom + Application.GetRealHeight(16);
+            jingyinBtn.Y = kuaijinBtn.Bottom + Application.GetRealHeight(bottomValue1);
             jingyinBtn.X = yinliangFL.Right + Application.GetRealWidth(37);
             backgroundOpenFl.AddChidren(jingyinBtn);
 
 
             shezhiBtn = new CustomButton();
             shezhiBtn.TextID = StringId.shezhi;
-            shezhiBtn.Y = kuaijinBtn.Bottom + Application.GetRealHeight(16);
+            shezhiBtn.Y = kuaijinBtn.Bottom + Application.GetRealHeight(bottomValue1);
             shezhiBtn.X = jingyinBtn.Right + Application.GetRealWidth(37);
             backgroundOpenFl.AddChidren(shezhiBtn);
 
@@ -561,28 +554,28 @@
 
             jiechujingyinBtn = new CustomButton();
             jiechujingyinBtn.TextID = StringId.jiechujingyin;
-            jiechujingyinBtn.Y = jingyinBtn.Bottom + Application.GetRealHeight(16);
+            jiechujingyinBtn.Y = jingyinBtn.Bottom + Application.GetRealHeight(bottomValue1);
             jiechujingyinBtn.X = yinliangFL.Right + Application.GetRealWidth(37);
             backgroundOpenFl.AddChidren(jiechujingyinBtn);
 
 
             fanhuiBtn = new CustomButton();
             fanhuiBtn.TextID = StringId.fanhui;
-            fanhuiBtn.Y = jingyinBtn.Bottom + Application.GetRealHeight(16);
+            fanhuiBtn.Y = jingyinBtn.Bottom + Application.GetRealHeight(bottomValue1);
             fanhuiBtn.X = jiechujingyinBtn.Right + Application.GetRealWidth(37);
             backgroundOpenFl.AddChidren(fanhuiBtn);
 
 
             TypeFrameLayout typeFrameLayout = new TypeFrameLayout();
-            typeFrameLayout.middLayout.Y = yinliangFL.Bottom + Application.GetRealHeight(32);
+            typeFrameLayout.middLayout.Y = yinliangFL.Bottom + Application.GetRealHeight(16);
             typeFrameLayout.AddView(backgroundOpenFl);
 
             muenFrameLayout = new MenuFramLayout();
-            muenFrameLayout.Y = Application.GetRealHeight(482);
+            muenFrameLayout.Y = Application.GetRealHeight(482-60);
             muenFrameLayout.AddView(backgroundOpenFl);
 
             sourceFrameLayout = new SourceFrameLayout();
-            sourceFrameLayout.Y = Application.GetRealHeight(482);
+            sourceFrameLayout.Y = Application.GetRealHeight(482-60);
             backgroundOpenFl.AddChidren(sourceFrameLayout);
             sourceFrameLayout.LoadSourcePage();
 
@@ -610,138 +603,7 @@
             #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 = "宸插叧鏈�",
-                TextID = StringId.yiguanji,
-                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,
-                TextID = StringId.kaiji,
-                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>
@@ -753,35 +615,7 @@
             this.topView.topNameBtn.TextID = StringId.dianshi;
             this.AddChidren(topView.TopFLayoutView());
         }
-        /// <summary>
-        /// 鏍规嵁璁惧寮�鍏崇姸鎬佹樉绀烘寚瀹氱晫闈�
-        /// (杩涙潵鐨勬椂鍊欑敤鍒�)
-        /// </summary>
-        /// <returns></returns>
-        private void CurrentAssignPage()
-        {
-            CommonMethod.Current.MainThread(() =>
-            {
 
-                if (this.device == null)
-                {
-                    vv.Visible = false;
-                    baseCloseFFL.Visible = true;
-                    return;
-                }
-                if (this.device.GetAttrState("on_off") == "on" || this.device.GetAttrState("on_off") == "1")
-                {
-                    vv.Visible = true;
-                    baseCloseFFL.Visible = false;
-                }
-                else
-                {
-                    vv.Visible = false;
-                    baseCloseFFL.Visible = true;
-                }
-            });
-
-        }
 
         /// <summary>
         /// 閲嶆柊璁$畻瀹藉害(璁惧鍚嶇О,鎴块棿鎺т欢)
@@ -803,23 +637,6 @@
                 //閲嶆柊璁$畻瀹藉害
                 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);
         }
 
@@ -830,7 +647,7 @@
     /// <summary>
     /// 鑷畾涔夛紙棣栭〉锛屽叧鏈猴紝鑿滃崟锛夊鍣�
     /// </summary>
-    class CustomFrameLayout : FrameLayout
+    class CustomFrameLayout : BaseFramLayout
     {
         public const int widthFrameLayout = 68;
         public const int heightFrameLayout = 68 + 8 + 20;
@@ -856,6 +673,7 @@
             TextID = StringId.dangqianmenweiguan,
             TextSize = TextSize.Text14,
             TextColor = MusicColor.TextColor,
+            SelectedTextColor = MusicColor.MusicTxet14SelectedColor,
             TextAlignment = TextAlignment.Center,
             Gravity = Gravity.CenterHorizontal,
             Name = "btnText",
@@ -887,19 +705,11 @@
         /// <param name="button2">娉ㄦ剰:鍦⊿etClickListener()鍓嶉潰璋冪敤AddImageView()鎵嶆湁鏁�</param>
         public void SetClickListener(Action<FrameLayout, Button, Button> action)
         {
-            EventHandler<MouseEventArgs> DownClick = (sender, e) =>
-            {
-                //this.BackgroundColor = 0xFFF2F3F7;
-                action?.Invoke(this, btnImage, btnText);
-            };
-            this.MouseDownEventHandler += DownClick;
-            btnImage.MouseDownEventHandler += DownClick;
-            btnText.MouseDownEventHandler += DownClick;
-
 
             EventHandler<MouseEventArgs> UpClick = (sender, e) =>
              {
-                 //this.BackgroundColor = 0x00000000;
+                 action?.Invoke(this, btnImage, btnText);
+                 SetButtonIsSelected(btnImage);
              };
             this.MouseUpEventHandler += UpClick;
             btnImage.MouseUpEventHandler += UpClick;
@@ -921,11 +731,15 @@
             this.Height = Application.GetRealHeight(38);
             this.TextSize = 14;
             this.TextColor = MusicColor.TextColor;
+            this.SelectedTextColor = MusicColor.MusicTxet14SelectedColor;
             this.TextAlignment = TextAlignment.Center;
             this.IsMoreLines = true;
-            this.BackgroundColor = 0xffECEDEE;
-            this.Radius = (uint)Application.GetRealHeight(30);
+            this.BackgroundColor = 0xFFF2F3F7;
+            this.SelectedBackgroundColor = 0xffECEDEE;
+            this.Radius = (uint)Application.GetRealHeight(19);
+            this.Padding = new Padding(0, 0, 0, 0);
         }
+
 
         /// <summary>
         /// 浜嬩欢鐩戝惉鏂规硶
@@ -933,17 +747,12 @@
         /// <param name="action">鍥炶皟(绗竴涓槸鐖剁被瀵硅薄</param>
         public void SetClickListener(Action<Button> action)
         {
-            EventHandler<MouseEventArgs> DownClick = (sender, e) =>
-            {
-                this.BackgroundColor = 0xFFF2F3F7;
-                action?.Invoke(this);
-            };
-            this.MouseDownEventHandler += DownClick;
-
-
             EventHandler<MouseEventArgs> UpClick = (sender, e) =>
             {
-                this.BackgroundColor = 0xffECEDEE;
+                
+                action?.Invoke(this);
+                new BaseFramLayout().SetButtonIsSelected(this);
+
             };
             this.MouseUpEventHandler += UpClick;
 
@@ -973,13 +782,14 @@
 
 
         Button leftBtnTitle = new Button
-        {
+        {  
             Height = Application.GetRealHeight(23),
             TextAlignment = TextAlignment.CenterLeft,
             TextColor = MusicColor.TextColor,
             SelectedTextColor = MusicColor.MusicTxet14SelectedColor,
             TextSize = TextSize.Text16,
             TextID = StringId.kongzhi,
+            Padding = new Padding(0, 0, 0, 0),
             IsBold = true,
         };
 
@@ -1013,7 +823,8 @@
             TextColor = MusicColor.TextColor,
             SelectedTextColor = MusicColor.MusicTxet14SelectedColor,
             TextSize = TextSize.Text16,
-            Text = "淇″彿婧�",
+            TextID = StringId.xinhaoyuan,
+            Padding = new Padding(0, 0, 0, 0),
             IsBold = true,
         };
 
@@ -1057,7 +868,7 @@
             rightLayout.AddChidren(clickRightLayout);
 
             leftBtnTitle.Width = leftLayout.Width;
-            leftBtnLine.Y = leftBtnTitle.Bottom + Application.GetRealHeight(4);
+            leftBtnLine.Y = leftBtnTitle.Bottom + Application.GetRealHeight(0);
             if (leftBtnTitle.GetTextWidth() < leftBtnTitle.Width)
             {
                 leftBtnTitle.Width = leftBtnTitle.GetTextWidth();
@@ -1074,7 +885,7 @@
 
 
 
-            rightBtnLine.Y = rightBtnTitle.Bottom + Application.GetRealHeight(4);
+            rightBtnLine.Y = rightBtnTitle.Bottom + Application.GetRealHeight(0);
 
             if (rightBtnTitle.GetTextWidth() < rightBtnTitle.Width)
             {

--
Gitblit v1.8.0