From d7094fc4ff54ada4c39868c8be1907e0a1c25b32 Mon Sep 17 00:00:00 2001 From: wxr <464027401@qq.com> Date: 星期二, 15 十二月 2020 09:10:58 +0800 Subject: [PATCH] Merge branch 'WJC' into NewFilePath --- HDL_ON/UI/UI2/3-Intelligence/Automation/PublicInterface.cs | 107 ++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 files changed, 105 insertions(+), 2 deletions(-) diff --git a/HDL_ON/UI/UI2/3-Intelligence/Automation/PublicInterface.cs b/HDL_ON/UI/UI2/3-Intelligence/Automation/PublicInterface.cs index b72d257..fe9cf05 100644 --- a/HDL_ON/UI/UI2/3-Intelligence/Automation/PublicInterface.cs +++ b/HDL_ON/UI/UI2/3-Intelligence/Automation/PublicInterface.cs @@ -13,7 +13,8 @@ /// <param name="titleText"></param> /// <param name="stateText">涔嬪墠鐘舵�佹枃鏈�</param> /// <param name="action">杩斿洖鍊�</param> - public void SingleSelectionShow(FrameLayout frameLayout, List<string> list, string titleText, string stateText, Action<string> action) + /// <param name="textSize">鏄剧ず鏂囨湰瀛椾綋澶у皬</param> + public void SingleSelectionShow(FrameLayout frameLayout, List<string> list, string titleText, string stateText,Action<string> action, int textSize=LogicView.TextSize.text14) { LogicView.DateView view = new LogicView.DateView(); view.btnTitle.Text = titleText; @@ -33,6 +34,7 @@ string str = list[i]; LogicView.CheckView checkView = new LogicView.CheckView(); checkView.frameLayout.Y = Application.GetRealHeight(56 + 50 * i); + checkView.btnText.TextSize = textSize; view.frameLayout.AddChidren(checkView.FLayoutView()); checkView.btnText.Text = str; checkView.btnClick.Tag = str;//鏍囪 @@ -75,7 +77,8 @@ /// <param name="titleText"></param> /// <param name="stateTextList">涔嬪墠鐘舵�佹枃鏈�</param> /// <param name="action">杩斿洖鍊�</param> - public void MultiSelectShow(FrameLayout frameLayout, List<string> list, string titleText, List<string> stateTextList, Action<List<string>> action) + /// <param name="textSize">鏄剧ず鏂囨湰瀛椾綋澶у皬</param> + public void MultiSelectShow(FrameLayout frameLayout, List<string> list, string titleText, List<string> stateTextList, Action<List<string>> action, int textSize = LogicView.TextSize.text14) { LogicView.DateView view = new LogicView.DateView(); view.btnTitle.Text = titleText; @@ -90,6 +93,7 @@ string str = list[i]; LogicView.CheckView checkView = new LogicView.CheckView(); checkView.frameLayout.Y = Application.GetRealHeight(56 + 50 * i); + checkView.btnText.TextSize = textSize; view.frameLayout.AddChidren(checkView.FLayoutView()); checkView.btnText.Text = str; checkView.btnClick.Tag = str;//鏍囪 @@ -140,6 +144,105 @@ } + /// <summary> + /// 鏈�-澶氶�夋嫨 + /// </summary> + /// <param name="frameLayout">鐖舵帶浠�</param> + /// <param name="action">鏄剧ず鏂囨湰瀛椾綋澶у皬</param> + public void MonSelectShow(FrameLayout frameLayout,Logic logic, Action<List<string>> action) + { + LogicView.MonView monView = new LogicView.MonView(); + monView.btnTitle.TextID = StringId.monthly; + monView.FLayoutView(frameLayout); + monView.btnCancel.MouseUpEventHandler += (sender, e) => + { + monView.frameLayout.RemoveFromParent(); + }; + //瀹氫箟涓�涓眬閮╩onList鍒楄〃鐢ㄦ潵璁板綍閫変腑鏁版嵁; + List<string> monList = new List<string>(); + if (logic.cycle.type == "mon") + { + //鍔犺浇涔嬪墠淇濆瓨鐨勬暟鎹� + monList.AddRange(logic.cycle.value); + } + //瀹氫箟涓�涓彉閲忚褰曡鏁� + int lineSun = 0; + for (int i = 1; i < 32; i++) + { + Button monTextBtn = new Button + { + Width = Application.GetRealWidth(30), + Height = Application.GetRealWidth(30), + Radius = (uint)Application.GetRealWidth(15), + Text = i.ToString(), + TextSize = LogicView.TextSize.text14, + TextColor = CSS.CSS_Color.textColor, + SelectedTextColor = CSS.CSS_Color.view, + SelectedBackgroundColor = CSS.CSS_Color.textConfirmColor, + BackgroundColor = CSS.CSS_Color.viewTranslucence, + Tag = i, + }; + monView.frameLayout.AddChidren(monTextBtn); + if (lineSun > 0) + { + monTextBtn.X = Application.GetRealWidth(16 + ((i - 1) - lineSun * 7) * 46); + } + else + { + monTextBtn.X = Application.GetRealWidth(16 + (i - 1) * 46); + } + monTextBtn.Y = Application.GetRealWidth(58 + 10 + lineSun * (30 + 10)); + + if (i % 7 == 0) + { + //涓�瀹氭墽琛屽畬鍐嶅垽鏂槸鍚﹁鎹㈣. + lineSun = lineSun + 1; + + } + monTextBtn.MouseUpEventHandler += (sender, e) => + { + string clickIndex = monTextBtn.Tag.ToString(); + monTextBtn.IsSelected = !monTextBtn.IsSelected; + if (monTextBtn.IsSelected) + { + monTextBtn.IsSelected = true; + if (!monList.Contains(clickIndex)) + { + //娣诲姞閫変腑鏁版嵁 + monList.Add(clickIndex); + } + } + else + { + monTextBtn.IsSelected = false; + if (monList.Contains(clickIndex)) + { + //绉婚櫎閫変腑鏁版嵁 + monList.Remove(clickIndex); + } + } + }; + + if (monList.Contains(i.ToString())) + { + monTextBtn.IsSelected = true; + } + } + //纭畾鐐瑰嚮浜嬩欢 + monView.btnConfirm.MouseUpEventHandler += (sender1, e1) => + { + if (monList.Count == 0) + { + //鎻愮ず锛氳繕娌¢�変腑鎵ц鍛ㄦ湡 + return; + } + + + action(monList); + frameLayout.RemoveFromParent(); + }; + + } } } -- Gitblit v1.8.0