wxr
2023-02-24 7e8d169707c1c829b45172bffee4ecd00299185d
排序功能实现(未放开)
2个文件已添加
16个文件已修改
9736 ■■■■ 已修改文件
DLL/Shared.Droid.JPush.dll 补丁 | 查看 | 原始文档 | blame | 历史
DLL/Shared.Droid.JPush223.dll 补丁 | 查看 | 原始文档 | blame | 历史
HDL-ON_Android/Assets/Language.ini 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL-ON_Android/Properties/AndroidManifest.xml 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL-ON_Android/Resources/Resource.designer.cs 9303 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL-ON_iOS/Info.plist 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL-ON_iOS/Resources/Language.ini 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/Common/ApiUtlis.cs 10 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/Common/R.cs 5 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/Entity/Function/Function.cs 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/Entity/FunctionList.cs 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/HDL_ON.projitems 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/MainPage.cs 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI0-Public/TopViewDiv.cs 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI1-Login/LoginPage.cs 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI2/2-Classification/FunctionControlZone.cs 18 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI2/2-Classification/FunctionPage.cs 18 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI2/FuntionControlView/OrderFunctionPage.cs 340 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
DLL/Shared.Droid.JPush.dll
Binary files differ
DLL/Shared.Droid.JPush223.dll
Binary files differ
HDL-ON_Android/Assets/Language.ini
@@ -570,6 +570,7 @@
583=EZVIZ
584=Deployment status
585=Failed to obtain third-party platform information
586=Sort
2532=Visitor Invitation Record
@@ -1810,6 +1811,7 @@
583=萤石摄像头
584=布防状态
585=获取第三方平台信息失败
586=排序
2532=访客邀请记录
@@ -3026,6 +3028,7 @@
583=EZVIZ
584=Deployment status
585=Failed to obtain third-party platform information
586=Sort
2532=Visitor Invitation Record
@@ -4245,6 +4248,7 @@
583=EZVIZ
584=Deployment status
585=Failed to obtain third-party platform information
586=Sort
@@ -5450,6 +5454,7 @@
583=EZVIZ
584=Deployment status
585=Failed to obtain third-party platform information
586=Sort
1000=Влажност в стаята
HDL-ON_Android/Properties/AndroidManifest.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" android:versionName="1.6.4" package="com.hdl.onpro" xmlns:tools="http://schemas.android.com/tools" android:versionCode="202302201">
<manifest xmlns:android="http://schemas.android.com/apk/res/android" android:versionName="1.6.4" package="com.hdl.onpro" xmlns:tools="http://schemas.android.com/tools" android:versionCode="202302241">
    <uses-sdk android:minSdkVersion="26" android:targetSdkVersion="29" />
    <!--友盟-->
    <!--<uses-sdk android:minSdkVersion="8"></uses-sdk>-->
HDL-ON_Android/Resources/Resource.designer.cs
Diff too large
HDL-ON_iOS/Info.plist
@@ -98,9 +98,9 @@
    <key>UIStatusBarStyle</key>
    <string>UIStatusBarStyleLightContent</string>
    <key>CFBundleShortVersionString</key>
    <string>1.6.402302251</string>
    <string>1.6.402302261</string>
    <key>CFBundleVersion</key>
    <string>1.6.402251</string>
    <string>1.6.402261</string>
    <key>NSLocationWhenInUseUsageDescription</key>
    <string>Use geographic location to provide services such as weather</string>
    <key>NSAppleMusicUsageDescription</key>
HDL-ON_iOS/Resources/Language.ini
@@ -570,6 +570,7 @@
583=EZVIZ
584=Deployment status
585=Failed to obtain third-party platform information
586=Sort
2532=Visitor Invitation Record
@@ -1121,7 +1122,6 @@
7166=camera
7167=main switch
7168=PM10
@@ -1811,6 +1811,7 @@
583=萤石摄像头
584=布防状态
585=获取第三方平台信息失败
586=排序
2532=访客邀请记录
@@ -3027,6 +3028,7 @@
583=EZVIZ
584=Deployment status
585=Failed to obtain third-party platform information
586=Sort
2532=Visitor Invitation Record
@@ -4246,6 +4248,7 @@
583=EZVIZ
584=Deployment status
585=Failed to obtain third-party platform information
586=Sort
@@ -5451,6 +5454,7 @@
583=EZVIZ
584=Deployment status
585=Failed to obtain third-party platform information
586=Sort
1000=Влажност в стаята
HDL_ON/Common/ApiUtlis.cs
@@ -334,12 +334,12 @@
                            complateDevice = true;
                            MainPage.Log($"============设备============完成" + FunctionList.List.Functions.Count);
                        }
                    })
                    { IsBackground = true }.Start();
                    //})
                    //{ IsBackground = true }.Start();
                    //===================场景==========================
                    new System.Threading.Thread(() =>
                    {
                    ////===================场景==========================
                    //new System.Threading.Thread(() =>
                    //{
                        try
                        {
                            complateScene = false;
HDL_ON/Common/R.cs
@@ -4,7 +4,10 @@
{
    public static class StringId
    {
        /// <summary>
        /// 排序
        /// </summary>
        public const int Sort = 586;
        /// <summary>
        /// 获取第三方平台信息失败
        /// </summary>
HDL_ON/Entity/Function/Function.cs
@@ -523,6 +523,14 @@
                SetAttrState(sta.key, sta.value);
            }
        }
        /// <summary>
        /// 功能列表排序
        /// </summary>
        public int FunctionOrderNumber = 9999;
        /// <summary>
        /// 房间列表排序
        /// </summary>
        public int RoomOrderNumber = 9999;
        /// <summary>
HDL_ON/Entity/FunctionList.cs
@@ -94,7 +94,7 @@
        /// <returns></returns>
        public List<Function> GetAcstParentList()
        {
            return Functions.FindAll((obj) => obj.spk == SPK.AcstParent);
            return Functions.FindAll((obj) => obj.spk == SPK.AcstParent);//.OrderByDescending(o=>o.controlCounter).ToList()
        }
        /// <summary>
HDL_ON/HDL_ON.projitems
@@ -528,6 +528,7 @@
    <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\FuntionControlView\Music\A31UsbMusicList.cs" />
    <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\FuntionControlView\Music\CommonMethod.cs" />
    <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\FuntionControlView\Music\A31FlieList.cs" />
    <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\FuntionControlView\OrderFunctionPage.cs" />
  </ItemGroup>
  <ItemGroup>
    <Folder Include="$(MSBuildThisFileDirectory)Entity\Device\" />
HDL_ON/UI/MainPage.cs
@@ -26,7 +26,7 @@
        /// <summary>
        /// 版本号
        /// </summary>
        public static string VersionString = "1.6.3";
        public static string VersionString = "1.6.4";
        ///// <summary>
        ///// 客户端类型
        ///// </summary>
HDL_ON/UI/UI0-Public/TopViewDiv.cs
@@ -26,6 +26,7 @@
        /// </summary>
        Button btnBack;
        public Button btnTilte;
        /// <summary>
        /// 标题名称
        /// </summary>
@@ -79,7 +80,7 @@
        /// </summary>
        /// <param name="frame"></param>
        /// <param name="tilte"></param>
        public void LoadTopView(uint color = CSS_Color.TopViewColor)
        public void LoadTopView(uint color = CSS_Color.TopViewColor)//,Action<List<Function> action
        {
            contentView = new FrameLayout()
            {
@@ -98,7 +99,7 @@
            };
            contentView.AddChidren(btnBackIcon);
            Button btnTilte = new Button()
            btnTilte = new Button()
            {
                Gravity = Gravity.CenterHorizontal,
                Y = Application.GetRealHeight(30),
@@ -110,6 +111,7 @@
                Text = title
            };
            contentView.AddChidren(btnTilte);
            btnBack = new Button()
HDL_ON/UI/UI1-Login/LoginPage.cs
@@ -232,7 +232,7 @@
                    //etAccount.Text = "13418062953";
                    etAccount.Text = "13138683659";
                    //etAccount.Text = "15217626103";
                    etAccount.Text = "13377799637";
                    etAccount.Text = "18100573477";
                }
                else
                {
@@ -283,9 +283,9 @@
                {
                    etPassword.Text = "wsad123321";
                }
                else if (etAccount.Text == "13377799637")
                else if (etAccount.Text == "18100573477")
                {
                    etPassword.Text = "lc392962649";
                    etPassword.Text = "huang12345";
                }
                //etPassword.Text = "Hdl85521566";
                btnLogin.IsSelected = true;
HDL_ON/UI/UI2/2-Classification/FunctionControlZone.cs
@@ -456,6 +456,19 @@
                };
                bodyDiv.AddChidren(btnOffline);
            }
            //排序
            //btnIcon.MouseLongEventHandler = (sender, e) => {
            //    OrderEvent();
            //};
            //btnName.MouseLongEventHandler = (sender, e) => {
            //    OrderEvent();
            //};
            //btnFromFloor.MouseLongEventHandler = (sender, e) => {
            //    OrderEvent();
            //};
            //bodyDiv.MouseLongEventHandler = (sender, e) => {
            //    OrderEvent();
            //};
        }
        /// <summary>
@@ -618,6 +631,11 @@
        }
        /// <summary>
        /// 排序事件
        /// </summary>
        public Action OrderEvent;
        /// <summary>
        /// 加载音乐功能控制卡片
        /// </summary>
        void MusicFragment()
HDL_ON/UI/UI2/2-Classification/FunctionPage.cs
@@ -267,6 +267,7 @@
                                    Tag = function.spk + function.sid
                                };
                                functionDiv.LoadFunctionDiv();
                                functionDiv.OrderEvent = OrderEvent;
                                functionListView.AddChidren(functionDiv);
                            }
                            else if (function.spk == SPK.IpCam_Imou)
@@ -300,6 +301,7 @@
                                    Tag = function.spk + function.sid
                                };
                                functionDiv.LoadFunctionDiv();
                                functionDiv.OrderEvent = OrderEvent;
                                functionListView.AddChidren(functionDiv);
                            }
                            functionListView.AddChidren(new Button() { Height = Application.GetRealHeight(10) });
@@ -346,7 +348,21 @@
            })
            { IsBackground = true }.Start();
        }
        /// <summary>
        /// 排序事件
        /// </summary>
        void OrderEvent()
        {
            Action action = () =>
            {
                functionList = functionList.OrderBy(o => o.FunctionOrderNumber).ToList();
                ShowFunctionRow(functionList);
            };
            var skipView = new OrderFunctionPage();
            MainPage.BasePageView.AddChidren(skipView);
            skipView.LoadPage(functionList, action);
            MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1;
        }
        ///// <summary>
        ///// 加载功能类型控制卡片
HDL_ON/UI/UI2/FuntionControlView/OrderFunctionPage.cs
New file
@@ -0,0 +1,340 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading;
using HDL_ON.DAL.Server;
using HDL_ON.DriverLayer;
using HDL_ON.Entity;
using HDL_ON.UI.CSS;
using Shared;
namespace HDL_ON.UI
{
    public class OrderFunctionPage : FrameLayout
    {
        #region 控件列表
        /// <summary>
        /// 当前窗体
        /// </summary>
        static FrameLayout bodyView;
        /// <summary>
        /// 功能列表集合显示区域
        /// </summary>
        static VerticalScrolViewLayout functionListView;
        /// <summary>
        /// 完成按钮
        /// </summary>
        Button btnConfrim;
        #endregion
        /// <summary>
        /// 回调刷新
        /// </summary>
        Action<Scene> backActon;
        List<Function> orderList = new List<Function>();
        List<int> orderNumber = new List<int>();
        public OrderFunctionPage()
        {
            bodyView = this;
        }
        public void LoadPage(List<Function> functions,Action action)
        {
            List<int> orderNumberAlreay = new List<int>();
            for (int i=0;i< functions.Count; i++)
            {
                if (functions[i].FunctionOrderNumber != 9999)
                {
                    orderNumberAlreay.Add(functions[i].FunctionOrderNumber);
                }
            }
            for (int i = 1; i < functions.Count + 1; i++)
            {
                if (!orderNumberAlreay.Contains(i))
                {
                    orderNumber.Add(i);
                }
            }
            bodyView.BackgroundColor = CSS_Color.BackgroundColor;
            new TopViewDiv(bodyView, Language.StringByID(StringId.Sort)).LoadTopView();
            functionListView = new VerticalScrolViewLayout()
            {
                Y = Application.GetRealHeight(84),
                Height = Application.GetRealHeight(640 - 100),
            };
            bodyView.AddChidren(functionListView);
            LoadRow(functions);
            #region 底部view
            var bottomView = new FrameLayout()
            {
                Y = Application.GetRealHeight(591),
                Height = Application.GetRealHeight(100),
                BackgroundColor = CSS_Color.MainBackgroundColor,
                Radius = (uint)Application.GetRealWidth(12),
            };
            this.AddChidren(bottomView);
            btnConfrim = new Button()
            {
                Y = Application.GetRealHeight(12),
                Gravity = Gravity.CenterHorizontal,
                Width = Application.GetRealWidth(220),
                Height = Application.GetRealHeight(44),
                Radius = (uint)Application.GetRealHeight(22),
                TextAlignment = TextAlignment.Center,
                TextColor = CSS_Color.MainBackgroundColor,
                BackgroundColor = CSS_Color.BackgroundColor,
                TextID = StringId.Confirm,
                TextSize = CSS_FontSize.SubheadingFontSize,
                SelectedTextColor = CSS_Color.MainBackgroundColor,
                SelectedBackgroundColor = CSS_Color.MainColor,
                IsSelected = true
            };
            bottomView.AddChidren(btnConfrim);
            btnConfrim.MouseUpEventHandler = (sender, e) => {
                foreach(var function in functions)
                {
                    function.SaveFunctionFile();
                }
                    action?.Invoke();
                    this.RemoveFromParent();
            };
            #endregion
        }
        /// <summary>
        /// 显示的设备的总数
        /// </summary>
        int showCount = 0;
        /// <summary>
        /// 加载功能row
        /// </summary>
        /// <param name="lightList"></param>
        void LoadRow(List<Function> functions, bool isAppend = false)
        {
            var waitPage = new Loading();
            bodyView.AddChidren(waitPage);
            waitPage.Start("");
            new System.Threading.Thread(() =>
            {
                try
                {
                    Application.RunOnMainThread(() =>
                    {
                        if (!isAppend)
                        {
                            showCount = 0;
                            functionListView.RemoveAll();
                        }
                        int i = 0;
                        foreach (var function in functions)
                        {
                            i++;
                            if (i > 100)
                            {
                                break;
                            }
                            showCount++;
                            var functionDiv = new OrderFunctionRow()
                            {
                                Gravity = Gravity.CenterHorizontal,
                                Width = Application.GetRealWidth(343),
                                Height = Application.GetRealHeight(62),
                                Radius = (uint)Application.GetMinRealAverage(12),
                                BorderColor = 0x00FFFFFF,
                                BorderWidth = 1,
                                BackgroundColor = CSS_Color.MainBackgroundColor,
                            };
                            functionDiv.LoadDiv(function, orderNumber);
                            functionListView.AddChidren(functionDiv);
                            functionListView.AddChidren(new Button() { Height = Application.GetRealHeight(12) });
                        }
                        if (functions.Count > showCount)
                        {
                            var btnAppend = new Button()
                            {
                                Height = Application.GetRealHeight(60),
                                TextAlignment = TextAlignment.Center,
                                TextSize = CSS_FontSize.SubheadingFontSize,
                                TextColor = CSS_Color.FirstLevelTitleColor,
                                Text = "加载更多",
                            };
                            if (Language.CurrentLanguage != "Chinese")
                            {
                                btnAppend.Text = "Load more";
                            }
                            functionListView.AddChidren(btnAppend);
                            btnAppend.MouseUpEventHandler = (sender, e) =>
                            {
                                btnAppend.RemoveFromParent();
                                LoadRow(functions, true);
                            };
                        }
                    });
                }
                catch (Exception ex)
                {
                    MainPage.Log("ShowFunctionRowError : " + ex.Message);
                }
                finally
                {
                    Application.RunOnMainThread(() =>
                    {
                        if (waitPage != null)
                        {
                            waitPage.RemoveFromParent();
                            waitPage = null;
                        }
                    });
                }
            })
            { IsBackground = true }.Start();
        }
    }
    public class OrderFunctionRow : FrameLayout
    {
        #region 区域控件
        static FrameLayout bodyDiv;
        /// <summary>
        /// 功能/场景icon
        /// </summary>
        Button btnIcon;
        /// <summary>
        /// 功能名称/场景名称
        /// </summary>
        Button btnName;
        /// <summary>
        /// 楼层信息显示按钮
        /// </summary>
        Button btnFromFloor;
        /// <summary>
        /// 选中按钮
        /// </summary>
        Button btnSelect;
        #endregion
        public OrderFunctionRow()
        {
            bodyDiv = this;
        }
        /// <summary>
        /// 加载控制卡片区域
        /// </summary>
        public void LoadDiv(Function function, List<int> orderNumber)
        {
            btnIcon = new Button()
            {
                X = Application.GetRealWidth(10),
                Y = Application.GetRealHeight(15),
                Width = Application.GetRealWidth(32),
                Height = Application.GetRealWidth(32),
                UnSelectedImagePath = $"FunctionIcon/Icon/{function.IconName}.png"
            };
            bodyDiv.AddChidren(btnIcon);
            btnName = new Button()
            {
                X = Application.GetRealWidth(8 + 10 + 32),
                Y = Application.GetRealHeight(10),
                Width = Application.GetRealWidth(200),
                Height = Application.GetRealHeight(24),
                Text = function.name,
                TextAlignment = TextAlignment.CenterLeft,
                TextColor = CSS_Color.FirstLevelTitleColor,
                TextSize = CSS_FontSize.TextFontSize,
            };
            bodyDiv.AddChidren(btnName);
            btnFromFloor = new Button()
            {
                X = Application.GetRealWidth(8 + 10 + 32),
                Y = Application.GetRealHeight(10 + 24),
                Width = Application.GetRealWidth(200),
                Height = Application.GetRealHeight(18),
                Text = function.GetRoomListName(),
                TextAlignment = TextAlignment.CenterLeft,
                TextColor = CSS_Color.PromptingColor1,
                TextSize = CSS_FontSize.PromptFontSize_FirstLevel,
            };
            bodyDiv.AddChidren(btnFromFloor);
            btnSelect = new Button()
            {
                X = Application.GetRealWidth(303),
                Gravity = Gravity.CenterVertical,
                Width = Application.GetRealWidth(32),
                Height = Application.GetRealWidth(32),
                Text = function.FunctionOrderNumber == 9999 ? "" : function.FunctionOrderNumber.ToString(),
                TextColor = CSS_Color.FirstLevelTitleColor,
                TextSize = CSS_FontSize.SubheadingFontSize,
                TextAlignment = TextAlignment.Center,
            };
            bodyDiv.AddChidren(btnSelect);
            EventHandler<MouseEventArgs> eventHandler = (sender, e) => {
                lock (orderNumber)
                {
                    if (function.FunctionOrderNumber == 9999)
                    {
                        function.FunctionOrderNumber = orderNumber[0];
                        orderNumber.RemoveAt(0);
                        btnSelect.Text = function.FunctionOrderNumber.ToString();
                    }
                    else
                    {
                        if (!orderNumber.Contains(function.FunctionOrderNumber))
                        {
                            for (var i = 0; i < orderNumber.Count; i++)
                            {
                                if (orderNumber[i] > function.FunctionOrderNumber)
                                {
                                    orderNumber.Insert(i, function.FunctionOrderNumber);
                                    function.FunctionOrderNumber = 9999;
                                    break;
                                }
                            }
                        }
                        if (function.FunctionOrderNumber != 9999)
                        {
                            orderNumber.Add(function.FunctionOrderNumber);
                            function.FunctionOrderNumber = 9999;
                        }
                        btnSelect.Text = "";
                    }
                }
            };
            btnName.MouseUpEventHandler = eventHandler;
            btnSelect.MouseUpEventHandler = eventHandler;
            bodyDiv.MouseUpEventHandler = eventHandler;
        }
    }
}