mac
2023-10-18 282f291d9279319b0e6b4a882b02ed2b50501c04
2023年10月18日15:27:09

埃克斯动态计算文本宽度
12个文件已修改
139 ■■■■ 已修改文件
HDL_ON/DAL/Server/HttpUtil.cs 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI2/3-Intelligence/Automation/ConditionDeviceFunList.cs 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI2/3-Intelligence/Automation/InpOrOutLogicMethod.cs 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI2/FuntionControlView/Aks/CommonView/BaseFramLayout.cs 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI2/FuntionControlView/Aks/CommonView/ButtonFramLayout.cs 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI2/FuntionControlView/Aks/CommonView/TypeSingleFramLayout.cs 63 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI2/FuntionControlView/Aks/GfPage.cs 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI2/FuntionControlView/Aks/JdhPage.cs 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI2/FuntionControlView/Aks/MusicPage.cs 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI2/FuntionControlView/Aks/TvPage.cs 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI2/FuntionControlView/Aks/TyyPage.cs 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI2/FuntionControlView/Aks/YkqPage.cs 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/DAL/Server/HttpUtil.cs
@@ -18,8 +18,8 @@
        /// 固定域名,正式环境
        /// 公共域名就近解析
        /// </summary>
        public const string GlobalRequestHttpsHost = "https://nearest.hdlcontrol.com";
        //public const string GlobalRequestHttpsHost = "https://test-gz.hdlcontrol.com";
        //public const string GlobalRequestHttpsHost = "https://nearest.hdlcontrol.com";
        public const string GlobalRequestHttpsHost = "https://test-gz.hdlcontrol.com";
        const string APP_KEY = "HDL-HOME-APP-TEST";
        const string SECRET_KEY = "WeJ8TY88vbakCcnvH8G1tDUqzLWY8yss";
HDL_ON/UI/UI2/3-Intelligence/Automation/ConditionDeviceFunList.cs
@@ -998,11 +998,19 @@
                    case StringId.onLogic:
                        {
                            value = "on";
                            if (device.spk== SPK.SensorDryContact) {
                                value = "open";
                            }
                        }
                        break;
                    case StringId.offLogic:
                        {
                            value = "off";
                            if (device.spk == SPK.SensorDryContact)
                            {
                                value = "close";
                            }
                        }
                        break;
                    case StringId.youren:
HDL_ON/UI/UI2/3-Intelligence/Automation/InpOrOutLogicMethod.cs
@@ -218,9 +218,9 @@
                                case SPK.SensorDryContact2:
                                    {
                                        string value = this.GetKeyValue("on_off", dicList);
                                        string value = this.GetKeyValue("contact_status", dicList);
                                        inputView.btnState.Text = Language.StringByID(StringId.offLogic);
                                        if (value == "on")
                                        if (value == "open")
                                        {
                                            inputView.btnState.Text = Language.StringByID(StringId.onLogic);
                                        }
@@ -2292,7 +2292,7 @@
                        foreach (var dic in dicList)
                        {
                            string value = dic["value"];
                            if (value == "on")
                            if (value == "open")
                            {
                                button1.Text = Language.StringByID(StringId.onLogic);
                            }
HDL_ON/UI/UI2/FuntionControlView/Aks/CommonView/BaseFramLayout.cs
@@ -2,7 +2,7 @@
using Shared;
namespace HDL_ON.UI.UI2.FuntionControlView.Aks.CommonView
{
    public class BaseFramLayout:FrameLayout
    public class BaseFramLayout : FrameLayout
    {
        public BaseFramLayout()
        {
@@ -61,9 +61,9 @@
            return bottomHeight;
        }
    }
}
HDL_ON/UI/UI2/FuntionControlView/Aks/CommonView/ButtonFramLayout.cs
@@ -152,9 +152,8 @@
        {
            EventHandler<MouseEventArgs> UpClick = (sender, e) =>
            {
                this.BackgroundColor = 0x00000000;
                action?.Invoke(this, btnImage, btnName);
                this.BackgroundColor = 0x00000000;
                //弹起来还原背景颜色
            };
HDL_ON/UI/UI2/FuntionControlView/Aks/CommonView/TypeSingleFramLayout.cs
@@ -53,8 +53,7 @@
            TextColor = MusicColor.TextColor,
            TextAlignment = TextAlignment.Center,
            Gravity = Gravity.CenterVertical,
            IsMoreLines = true,
            Padding=new Padding(0,0,0,0),
            Padding = new Padding(0, 0, 0, 0),
            Name = "btnName",
        };
@@ -114,12 +113,70 @@
            {
                //按下去改变背景颜色
                //singleFramLayout.BackgroundColor = this.DownBackgroundColor;
            };
            singleFramLayout.MouseDownEventHandler += DownClick;
            btnLeftImage.MouseDownEventHandler += DownClick;
            btnName.MouseDownEventHandler += DownClick;
            btnRightImage.MouseDownEventHandler += DownClick;
        }
        /// <summary>
        /// 自动计算控件长度
        /// </summary>
        /// <param name="orientation">位置(左或右)</param>
        /// <param name="frame">父容器</param>
        /// <param name="btnName">备注控件</param>
        /// <param name="btnImage">图标备注控件</param>
        /// <param name="btnNameWidth">备注控件宽度</param>
        /// <param name="btnNameWidthMaxValue">备注控件宽度最大值</param>
        /// <param name="parentDefaultWidthMaxValue">父控件宽度默认最大值</param>
        public void CustomCalculationWidth(Orientation orientation, FrameLayout frame, Button btnName, Button btnImage, int btnNameWidth,int btnNameWidthMaxValue = 110, int parentDefaultWidthMaxValue = 101)
        {
            int parentRightX = 226;
            int parentLeftX = 16;
            if (btnName.GetTextWidth() > Application.GetRealWidth(btnNameWidth))
            {
                frame.Width = Application.GetRealWidth(parentDefaultWidthMaxValue - btnNameWidth) + btnName.GetTextWidth();
                if (orientation == Orientation.right)
                {
                    frame.X = Application.GetRealWidth(parentRightX + btnNameWidth) - btnName.GetTextWidth();
                }
                else if (orientation == Orientation.left)
                {
                    frame.X = Application.GetRealWidth(parentLeftX);
                }
                btnName.Width = btnName.GetTextWidth();
                btnImage.X = btnName.Right + Application.GetRealWidth(8);
            }
            if (btnName.GetTextWidth() > Application.GetRealWidth(btnNameWidthMaxValue))
            {
                btnName.Width = Application.GetRealWidth(btnNameWidthMaxValue);
                if (orientation == Orientation.right)
                {
                    frame.X =Application.GetRealWidth(parentRightX+ btnNameWidth) - btnName.Width;
                }
                else if (orientation == Orientation.left)
                {
                    frame.X = Application.GetRealWidth(parentLeftX);
                }
                frame.Width = Application.GetRealWidth(parentDefaultWidthMaxValue - btnNameWidth) + btnName.Width;
                btnImage.X = btnName.Right + Application.GetRealWidth(8);
            }
        }
        public enum Orientation
        {
            left,
            right,
        }
    }
}
HDL_ON/UI/UI2/FuntionControlView/Aks/GfPage.cs
@@ -140,14 +140,11 @@
                gfSingleFramLayout.btnRightImage.UnSelectedImagePath = "AksIcon/xuanze.png";
                gfSingleFramLayout.btnRightImage.Gravity = Gravity.CenterVertical;
                gfSingleFramLayout.btnLeftImage.Visible = false;
                if (gfSingleFramLayout.btnName.GetTextWidth() > Application.GetRealWidth(48))
                {
                    gfSingleFramLayout.singleFramLayout.Width = Application.GetRealWidth(101 - 48) + gfSingleFramLayout.btnName.GetTextWidth();
                    gfSingleFramLayout.singleFramLayout.X = Application.GetRealWidth(226 + 48) - gfSingleFramLayout.btnName.GetTextWidth();
                    gfSingleFramLayout.btnName.Width = gfSingleFramLayout.btnName.GetTextWidth();
                    gfSingleFramLayout.btnRightImage.X = gfSingleFramLayout.btnName.Right + Application.GetRealWidth(8);
                }
                gfSingleFramLayout.CustomCalculationWidth(TypeSingleFramLayout.Orientation.right,
                gfSingleFramLayout.singleFramLayout,
                gfSingleFramLayout.btnName,
                gfSingleFramLayout.btnRightImage,
                48, 200);
            }
            else
            {
HDL_ON/UI/UI2/FuntionControlView/Aks/JdhPage.cs
@@ -301,6 +301,11 @@
                jdhSingleFramLayout.btnRightImage.UnSelectedImagePath = "AksIcon/xuanze.png";
                jdhSingleFramLayout.btnRightImage.Gravity = Gravity.CenterVertical;
                jdhSingleFramLayout.btnLeftImage.Visible = false;
                jdhSingleFramLayout.CustomCalculationWidth(TypeSingleFramLayout.Orientation.right,
                jdhSingleFramLayout.singleFramLayout,
                jdhSingleFramLayout.btnName,
                 jdhSingleFramLayout.btnRightImage,
                 48, 200);
            }
            else
            {
HDL_ON/UI/UI2/FuntionControlView/Aks/MusicPage.cs
@@ -181,9 +181,11 @@
                bfqSingleFramLayout.btnRightImage.UnSelectedImagePath = "AksIcon/xuanze.png";
                bfqSingleFramLayout.btnRightImage.Gravity = Gravity.CenterVertical;
                bfqSingleFramLayout.btnLeftImage.Visible = false;
                bfqSingleFramLayout.CustomCalculationWidth(TypeSingleFramLayout.Orientation.left,
                    bfqSingleFramLayout.singleFramLayout,
                    bfqSingleFramLayout.btnName,
                     bfqSingleFramLayout.btnRightImage,
                     48);
                //影库
                ykSingleFramLayout = new TypeSingleFramLayout();
HDL_ON/UI/UI2/FuntionControlView/Aks/TvPage.cs
@@ -307,6 +307,11 @@
                tvSingleFramLayout.btnRightImage.UnSelectedImagePath = "AksIcon/xuanze.png";
                tvSingleFramLayout.btnRightImage.Gravity = Gravity.CenterVertical;
                tvSingleFramLayout.btnLeftImage.Visible = false;
                tvSingleFramLayout.CustomCalculationWidth(TypeSingleFramLayout.Orientation.right,
                  tvSingleFramLayout.singleFramLayout,
                  tvSingleFramLayout.btnName,
                   tvSingleFramLayout.btnRightImage,
                   48, 200);
            }
            else
            {
HDL_ON/UI/UI2/FuntionControlView/Aks/TyyPage.cs
@@ -177,6 +177,12 @@
                tyySingleFramLayout.btnRightImage.UnSelectedImagePath = "AksIcon/xuanze.png";
                tyySingleFramLayout.btnRightImage.Gravity = Gravity.CenterVertical;
                tyySingleFramLayout.btnLeftImage.Visible = false;
               tyySingleFramLayout.CustomCalculationWidth(TypeSingleFramLayout.Orientation.right,
                    tyySingleFramLayout.singleFramLayout,
                    tyySingleFramLayout.btnName,
                     tyySingleFramLayout.btnRightImage,
                     48,200);
            }
            else
            {
HDL_ON/UI/UI2/FuntionControlView/Aks/YkqPage.cs
@@ -1174,13 +1174,11 @@
                tyySingleFramLayout.btnRightImage.Gravity = Gravity.CenterVertical;
                tyySingleFramLayout.btnLeftImage.Visible = false;
                if (tyySingleFramLayout.btnName.GetTextWidth() > Application.GetRealWidth(48))
                {
                    tyySingleFramLayout.singleFramLayout.Width = Application.GetRealWidth(101 - 48) + tyySingleFramLayout.btnName.GetTextWidth();
                    tyySingleFramLayout.singleFramLayout.X = Application.GetRealWidth(226 + 48) - tyySingleFramLayout.btnName.GetTextWidth();
                    tyySingleFramLayout.btnName.Width = tyySingleFramLayout.btnName.GetTextWidth();
                    tyySingleFramLayout.btnRightImage.X = tyySingleFramLayout.btnName.Right + Application.GetRealWidth(8);
                }
                tyySingleFramLayout.CustomCalculationWidth(TypeSingleFramLayout.Orientation.right,
                  tyySingleFramLayout.singleFramLayout,
                  tyySingleFramLayout.btnName,
                   tyySingleFramLayout.btnRightImage,
                   48, 200);
            }
            else