xm
2020-07-20 b02e8275a21dc06bf54b66273485d44e007a2616
ZigbeeApp/Shared/Phone/UserCenter/Device/Panel/PanelBackLighWithSensorForm.cs
old mode 100755 new mode 100644
@@ -7,7 +7,7 @@
{
    public class PanelBackLighWithSensorForm : EditorCommonForm
    {
        #region ■ 变量声明___________________________
        #region ■ 变量声明___________________________
        /// <summary>
        /// 列表控件
        /// </summary>
@@ -51,7 +51,7 @@
            set { btnSleepTime.Text = value; }
        }
        /// <summary>
        ///睡眠时间
        ///睡眠时间
        /// </summary>
        public NormalViewControl btnSleepTime = null;
@@ -123,7 +123,7 @@
        #endregion
        #region ■ 节能模式行_________________________
        #region ■ 节能模式行_________________________
        /// <summary>
        ///  添加节能模式行
        /// </summary>
@@ -219,7 +219,7 @@
            //添加接近感应
            this.AddProximitySensorsRow(frameBack);
            //底线
            //底线
            var btnLine = new NormalViewControl(965, 5, true);
            btnLine.Height = 1;
            btnLine.X = Application.GetRealWidth(52);
@@ -326,7 +326,7 @@
        }
        #endregion
        #region ■ 显示选择设备睡眠时间_______________
        #region ■ 显示选择设备睡眠时间_______________
        /// <summary>
        /// 显示选择设备睡眠时间的界面
        /// </summary>
@@ -431,9 +431,9 @@
            frameColor.Height = this.GetPictrueRealSize(79);
            frameColor.Y = Application.GetRealHeight(26);
            frameColor.X = listview.Width - ControlCommonResourse.XXLeft - Application.GetRealHeight(262);
            frameBack.AddChidren(frameColor);
            //颜色
            frameBack.AddChidren(frameColor);
            //颜色
            var btnColorView = new NormalViewControl(Application.GetRealHeight(110), this.GetPictrueRealSize(49), false);
            btnColorView.Gravity = Gravity.CenterVertical;
            btnColorView.TextAlignment = TextAlignment.CenterRight;
@@ -449,20 +449,24 @@
            uint backColor = this.GetColorByRGB((byte)R1, (byte)G1, (byte)B1);
            //颜色外框
            var btnColorLine = new FrameLayoutStatuControl();
            btnColorLine.Width = Application.GetRealHeight(79);
            btnColorLine.Height = this.GetPictrueRealSize(79);
            btnColorLine.X = btnColorView.Right + Application.GetRealHeight(18);
            btnColorLine.Radius = (uint)this.GetPictrueRealSize(79) / 2;
            btnColorLine.BorderWidth = 1;
            btnColorLine.BorderColor = 0xffcccccc;
            frameColor.AddChidren(btnColorLine, ChidrenBindMode.BindEvent);
            var frameColorLine = new FrameLayoutStatuControl();
            frameColorLine.UseClickStatu = false;
            frameColorLine.Height = this.GetPictrueRealSize(79);
            frameColorLine.Width = this.GetPictrueRealSize(79);
            frameColorLine.X = btnColorView.Right + Application.GetRealHeight(18);
            frameColorLine.Radius = (uint)this.GetPictrueRealSize(79) / 2;
            frameColorLine.BorderWidth = 1;
            frameColorLine.BorderColor = 0xffcccccc;
            frameColor.AddChidren(frameColorLine, ChidrenBindMode.NotBind);
            var btnColor = new NormalViewControl(this.GetPictrueRealSize(69), this.GetPictrueRealSize(69), false);
            //分两步计算,不然有可能它得出的结果有误差导致不居中
            int btnColorWidth = frameColorLine.Height - this.GetPictrueRealSize(7) - this.GetPictrueRealSize(7);
            var btnColor = new NormalViewControl(btnColorWidth, btnColorWidth, false);
            btnColor.Gravity = Gravity.Center;
            btnColor.Radius = (uint)this.GetPictrueRealSize(69) / 2;
            btnColor.Radius = (uint)btnColorWidth / 2;
            btnColor.BackgroundColor = backColor;
            btnColorLine.AddChidren(btnColor, ChidrenBindMode.BindEvent);
            frameColorLine.AddChidren(btnColor, ChidrenBindMode.NotBind);
            frameColor.ChangedChidrenBindMode(frameColorLine, ChidrenBindMode.BindEvent);
            //变更滑动条的颜色
            seekBar1.ProgressBarColor = backColor;
@@ -476,46 +480,22 @@
            frameColor.ButtonClickEvent += (sender, e) =>
            {
                PanelColor(btnColor, seekBar1, R1, G1, B1);
            };
            btnColorView.ButtonClickEvent += (sender, e) =>
            {
                PanelColor(btnColor, seekBar1, R1, G1, B1);
            };
            btnColor.ButtonClickEvent += (sender, e) =>
            {
                PanelColor(btnColor, seekBar1, R1, G1, B1);
            };
            btnColorLine.ButtonClickEvent += (sender, e) =>
            {
                PanelColor(btnColor, seekBar1, R1, G1, B1);
            };
            btnRight.ButtonClickEvent += (sender, e) =>
            {
                PanelColor(btnColor, seekBar1, R1, G1, B1);
            };
        }
                var form = new PanelColorSelectForm();
                form.AddForm(R1, G1, B1);
                form.FinishSelectColorEvent += (Rcolor, Gcolor, Bcolor) =>
                {
                    R1 = Rcolor;
                    G1 = Gcolor;
                    B1 = Bcolor;
        /// <summary>
        /// PanelColorBefore
        /// </summary>
        private void PanelColor(NormalViewControl btnColor, SeekBarControl seekBar1, int R1, int G1, int B1)
        {
            var form = new PanelColorSelectForm();
            form.AddForm(R1, G1, B1);
            form.FinishSelectColorEvent += (Rcolor, Gcolor, Bcolor) =>
            {
                R1 = Rcolor;
                G1 = Gcolor;
                B1 = Bcolor;
                    this.keyColorData.CloseColorR = Convert.ToString(Rcolor, 16);
                    this.keyColorData.CloseColorG = Convert.ToString(Gcolor, 16);
                    this.keyColorData.CloseColorB = Convert.ToString(Bcolor, 16);
                this.keyColorData.CloseColorR = Convert.ToString(Rcolor, 16);
                this.keyColorData.CloseColorG = Convert.ToString(Gcolor, 16);
                this.keyColorData.CloseColorB = Convert.ToString(Bcolor, 16);
                btnColor.BackgroundColor = this.GetColorByRGB((byte)Rcolor, (byte)Gcolor, (byte)Bcolor);
                //变更滑动条的颜色
                seekBar1.ProgressBarColor = btnColor.BackgroundColor;
                    btnColor.BackgroundColor = this.GetColorByRGB((byte)Rcolor, (byte)Gcolor, (byte)Bcolor);
                    //变更滑动条的颜色
                    seekBar1.ProgressBarColor = btnColor.BackgroundColor;
                };
            };
        }
@@ -535,8 +515,9 @@
            btnClick.TextSize = 12;
            btnClick.TextColor = UserCenterColor.Current.TextGrayColor3;
            btnClick.TextID = R.MyInternationalizationString.uAfterClick;
            listview.AddChidren(btnClick);
            //背景
            listview.AddChidren(btnClick);
            //背景
            var frameBack = new FrameLayout();
            frameBack.Y = Application.GetRealHeight(608);
            frameBack.Height = Application.GetRealHeight(395);
@@ -594,7 +575,6 @@
            frameColor.Y = Application.GetRealHeight(26);
            frameColor.X = listview.Width - ControlCommonResourse.XXLeft - Application.GetRealHeight(262);
            frameBack.AddChidren(frameColor);
            //颜色
            var btnColorView = new NormalViewControl(Application.GetRealHeight(110), this.GetPictrueRealSize(49), false);
            btnColorView.Gravity = Gravity.CenterVertical;
@@ -611,20 +591,24 @@
            uint backColor = this.GetColorByRGB((byte)R1, (byte)G1, (byte)B1);
            //颜色外框
            var btnColorLine = new FrameLayoutStatuControl();
            btnColorLine.Width = Application.GetRealHeight(79);
            btnColorLine.Height = this.GetPictrueRealSize(79);
            btnColorLine.X = btnColorView.Right + Application.GetRealHeight(18);
            btnColorLine.Radius = (uint)this.GetPictrueRealSize(79) / 2;
            btnColorLine.BorderWidth = 1;
            btnColorLine.BorderColor = 0xffcccccc;
            frameColor.AddChidren(btnColorLine, ChidrenBindMode.BindEvent);
            var frameColorLine = new FrameLayoutStatuControl();
            frameColorLine.UseClickStatu = false;
            frameColorLine.Height = this.GetPictrueRealSize(79);
            frameColorLine.Width = this.GetPictrueRealSize(79);
            frameColorLine.X = btnColorView.Right + Application.GetRealHeight(18);
            frameColorLine.Radius = (uint)this.GetPictrueRealSize(79) / 2;
            frameColorLine.BorderWidth = 1;
            frameColorLine.BorderColor = 0xffcccccc;
            frameColor.AddChidren(frameColorLine, ChidrenBindMode.NotBind);
            var btnColor = new NormalViewControl(this.GetPictrueRealSize(69), this.GetPictrueRealSize(69), false);
            //分两步计算,不然有可能它得出的结果有误差导致不居中
            int btnColorWidth = frameColorLine.Height - this.GetPictrueRealSize(7) - this.GetPictrueRealSize(7);
            var btnColor = new NormalViewControl(btnColorWidth, btnColorWidth, false);
            btnColor.Gravity = Gravity.Center;
            btnColor.Radius = (uint)this.GetPictrueRealSize(69) / 2;
            btnColor.Radius = (uint)btnColorWidth / 2;
            btnColor.BackgroundColor = backColor;
            btnColorLine.AddChidren(btnColor, ChidrenBindMode.BindEvent);
            frameColorLine.AddChidren(btnColor, ChidrenBindMode.NotBind);
            frameColor.ChangedChidrenBindMode(frameColorLine, ChidrenBindMode.BindEvent);
            //变更滑动条的颜色
            seekBar1.ProgressBarColor = backColor;
@@ -638,46 +622,22 @@
            frameColor.ButtonClickEvent += (sender, e) =>
            {
                PanelAfterColor(btnColor, seekBar1, R1, G1, B1);
            };
            btnColorView.ButtonClickEvent += (sender, e) =>
            {
                PanelAfterColor(btnColor, seekBar1, R1, G1, B1);
            };
            btnColor.ButtonClickEvent += (sender, e) =>
            {
                PanelAfterColor(btnColor, seekBar1, R1, G1, B1);
            };
            btnColorLine.ButtonClickEvent += (sender, e) =>
            {
                PanelAfterColor(btnColor, seekBar1, R1, G1, B1);
            };
            btnRight.ButtonClickEvent += (sender, e) =>
            {
                PanelAfterColor(btnColor, seekBar1, R1, G1, B1);
            };
        }
                var form = new PanelColorSelectForm();
                form.AddForm(R1, G1, B1);
                form.FinishSelectColorEvent += (Rcolor, Gcolor, Bcolor) =>
                {
                    R1 = Rcolor;
                    G1 = Gcolor;
                    B1 = Bcolor;
        /// <summary>
        /// PanelColorBefore
        /// </summary>
        private void PanelAfterColor(NormalViewControl btnColor, SeekBarControl seekBar1, int R1, int G1, int B1)
        {
            var form = new PanelColorSelectForm();
            form.AddForm(R1, G1, B1);
            form.FinishSelectColorEvent += (Rcolor, Gcolor, Bcolor) =>
            {
                R1 = Rcolor;
                G1 = Gcolor;
                B1 = Bcolor;
                    this.keyColorData.OpenColorR = Convert.ToString(Rcolor, 16);
                    this.keyColorData.OpenColorG = Convert.ToString(Gcolor, 16);
                    this.keyColorData.OpenColorB = Convert.ToString(Bcolor, 16);
                this.keyColorData.OpenColorR = Convert.ToString(Rcolor, 16);
                this.keyColorData.OpenColorG = Convert.ToString(Gcolor, 16);
                this.keyColorData.OpenColorB = Convert.ToString(Bcolor, 16);
                btnColor.BackgroundColor = this.GetColorByRGB((byte)Rcolor, (byte)Gcolor, (byte)Bcolor);
                //变更滑动条的颜色
                seekBar1.ProgressBarColor = btnColor.BackgroundColor;
                    btnColor.BackgroundColor = this.GetColorByRGB((byte)Rcolor, (byte)Gcolor, (byte)Bcolor);
                    //变更滑动条的颜色
                    seekBar1.ProgressBarColor = btnColor.BackgroundColor;
                };
            };
        }
        #endregion
@@ -775,7 +735,7 @@
        #endregion
        #region ■ 补充容器___________________________
        #region ■ 补充容器___________________________
        /// <summary>
        /// 行数超过容器时,补一个空白FrameLayout,使之能滑动
        /// </summary>
@@ -814,6 +774,6 @@
            return (uint)(0xFF000000 + R * 256 * 256 + G * 256 + B);
        }
        #endregion
        #endregion
    }
}