From 25429f085093d89d543a0b90e30d0d62d1b7dac9 Mon Sep 17 00:00:00 2001
From: hxb <hxb@hdlchina.com.cn>
Date: 星期二, 30 八月 2022 09:37:38 +0800
Subject: [PATCH] 合并了IOS的代码
---
ZigbeeApp/Shared/Phone/Category/AdjustTargetAddDelayTimeForm.cs | 158 ++++++++++++++++++++++++++++------------------------
1 files changed, 84 insertions(+), 74 deletions(-)
diff --git a/ZigbeeApp/Shared/Phone/Category/AdjustTargetAddDelayTimeForm.cs b/ZigbeeApp/Shared/Phone/Category/AdjustTargetAddDelayTimeForm.cs
index 5f1d3e6..2173df9 100755
--- a/ZigbeeApp/Shared/Phone/Category/AdjustTargetAddDelayTimeForm.cs
+++ b/ZigbeeApp/Shared/Phone/Category/AdjustTargetAddDelayTimeForm.cs
@@ -1,22 +1,22 @@
-锘縰sing System;
-using System.Collections.Generic;
+锘縰sing System;
+using System.Collections.Generic;
using Shared.Phone.UserCenter;
-namespace Shared.Phone.Category
-{
+namespace Shared.Phone.Category
+{
/// <summary>
/// 鍦烘櫙鎵ц鐩爣娣诲姞寤舵椂鐨勭晫闈�
- /// </summary>
- public class AdjustTargetAddDelayTimeForm : EditorCommonForm
+ /// </summary>
+ public class AdjustTargetAddDelayTimeForm : EditorCommonForm
{
- #region 鈻� 鍙橀噺澹版槑___________________________
-
+ #region 鈻� 鍙橀噺澹版槑___________________________
+
/// <summary>
/// 纭畾閫夋嫨鐨勪簨浠�
- /// </summary>
- public Action<int> FinishSelectEvent = null;
-
- #endregion
+ /// </summary>
+ public Action<int> FinishSelectEvent = null;
+
+ #endregion
#region 鈻� 鍒濆鍖朹____________________________
@@ -39,33 +39,38 @@
private void InitMiddleFrame(int i_delayTime)
{
int selectTime = i_delayTime;
+ if (selectTime == 0)
+ {
+ //榛樿1绉�
+ selectTime = 1;
+ }
//鍥炬爣绗竴灞傚簳鑹�
var frameFirstBack = new FrameLayout();
frameFirstBack.Y = Application.GetRealHeight(118);
- frameFirstBack.Height = Application.GetMinRealAverage(207);
- frameFirstBack.Width = Application.GetMinRealAverage(207);
+ frameFirstBack.Height = this.GetPictrueRealSize(207);
+ frameFirstBack.Width = this.GetPictrueRealSize(207);
frameFirstBack.BackgroundColor = UserCenterColor.Current.White;
- frameFirstBack.Radius = (uint)Application.GetMinRealAverage(207) / 2;
- frameFirstBack.Gravity = Gravity.CenterHorizontal;
+ frameFirstBack.Radius = (uint)this.GetPictrueRealSize(207) / 2;
+ frameFirstBack.Gravity = Gravity.CenterHorizontal;
bodyFrameLayout.AddChidren(frameFirstBack);
//闃叉鍑虹幇璇樊
- int iconWidth = Application.GetMinRealAverage(207) - Application.GetMinRealAverage(12) - Application.GetMinRealAverage(12);
+ int iconWidth = this.GetPictrueRealSize(207) - this.GetPictrueRealSize(12) - this.GetPictrueRealSize(12);
//鍥炬爣绗簩灞傚簳鑹�
var btnSecondBack = new NormalViewControl(iconWidth, iconWidth, false);
btnSecondBack.BackgroundColor = 0xfffef1ed;
btnSecondBack.Radius = (uint)iconWidth / 2;
btnSecondBack.Gravity = Gravity.Center;
- frameFirstBack.AddChidren(btnSecondBack);
- //鍥炬爣
- var btnIcon = new IconViewControl(124);
- btnIcon.UnSelectedImagePath = "Item/Timer.png";
- btnIcon.Gravity = Gravity.Center;
- frameFirstBack.AddChidren(btnIcon);
-
- //涓轰綘鐨勫姩浣滃垱寤烘椂闂撮棿闅�
- var btnMsg = new NormalViewControl(700, 62, true);
- btnMsg.Y = frameFirstBack.Bottom + Application.GetRealHeight(34);
+ frameFirstBack.AddChidren(btnSecondBack);
+ //鍥炬爣
+ var btnIcon = new IconViewControl(124);
+ btnIcon.UnSelectedImagePath = "Item/Timer.png";
+ btnIcon.Gravity = Gravity.Center;
+ frameFirstBack.AddChidren(btnIcon);
+
+ //涓轰綘鐨勫姩浣滃垱寤烘椂闂撮棿闅�
+ var btnMsg = new NormalViewControl(700, 62, true);
+ btnMsg.Y = frameFirstBack.Bottom + Application.GetRealHeight(34);
btnMsg.TextSize = 15;
btnMsg.TextID = R.MyInternationalizationString.SelectTimeForAction;
btnMsg.TextAlignment = TextAlignment.Center;
@@ -79,50 +84,55 @@
frameWhiteBack.Height = Application.GetRealHeight(1500);//瓒呰繃搴曢儴鍗冲彲
frameWhiteBack.Radius = (uint)Application.GetRealHeight(58);
bodyFrameLayout.AddChidren(frameWhiteBack);
- //婊戝姩鎺т欢
- var pickView = new UIPickerView();
+ //婊戝姩鎺т欢
+ var pickView = new UIPickerView();
pickView.Y = Application.GetRealHeight(127);
- pickView.Height = Application.GetRealHeight(153 * 3);
- frameWhiteBack.AddChidren(pickView);
-
- //鍒�
- string strMinute = Language.StringByID(R.MyInternationalizationString.uMinute);
- //绉�
- string strSecond = Language.StringByID(R.MyInternationalizationString.uSecond);
- var listfirst = new List<string>();
- var listSecond = new List<List<string>>();
- for (int i = 0; i <= 59; i++)
- {
- listfirst.Add(i.ToString().PadLeft(2, '0') + strMinute);
- var listTemp = new List<string>();
- for (int j = 0; j <= 59; j++)
- {
- if (i == 0 && j == 0)
- {
- continue;
- }
- listTemp.Add(j.ToString().PadLeft(2, '0') + strSecond);
- }
- listSecond.Add(listTemp);
- }
- //鍔犱竴涓�60鍒嗛挓鍚�
- listfirst.Add("60" + strMinute);
- var listTemp2 = new List<string>() { "00" + strSecond };
+ pickView.Height = Application.GetRealHeight(153 * 3);
+ frameWhiteBack.AddChidren(pickView);
+
+ //鍒�
+ string strMinute = Language.StringByID(R.MyInternationalizationString.uMinute);
+ //绉�
+ string strSecond = Language.StringByID(R.MyInternationalizationString.uSecond);
+ var listfirst = new List<string>();
+ var listSecond = new List<List<string>>();
+ for (int i = 0; i <= 59; i++)
+ {
+ listfirst.Add(i.ToString().PadLeft(2, '0') + strMinute);
+ var listTemp = new List<string>();
+ for (int j = 0; j <= 59; j++)
+ {
+ if (i == 0 && j == 0)
+ {
+ continue;
+ }
+ listTemp.Add(j.ToString().PadLeft(2, '0') + strSecond);
+ }
+ listSecond.Add(listTemp);
+ }
+ //鍔犱竴涓�60鍒嗛挓鍚�
+ listfirst.Add("60" + strMinute);
+ var listTemp2 = new List<string>() { "00" + strSecond };
listSecond.Add(listTemp2);
- pickView.setPicker(listfirst, listSecond);
- pickView.setCurrentItems(selectTime / 60, selectTime % 60, 0);
- pickView.OnSelectChangeEvent += (value1, value2, value3) =>
+ int firstIndex = selectTime / 60;
+ int secondIndex = selectTime % 60;
+ //鍥犱负0鍒嗙殑鏃跺�欙紝瀹冩槸浠�1绉掑紑濮嬬殑锛屾墍浠ュ畠鐨勭储寮曢渶瑕�-1
+ if (firstIndex == 0) { secondIndex--; }
+
+ pickView.setPicker(listfirst, listSecond);
+ pickView.setCurrentItems(firstIndex, secondIndex, 0);
+ pickView.OnSelectChangeEvent += (value1, value2, value3) =>
{
int minute = Convert.ToInt32(listfirst[value1].Substring(0, 2));
int second = Convert.ToInt32(listSecond[value1][value2].Substring(0, 2));
- selectTime = minute * 60 + second;
- };
-
- //瀹屾垚鎸夐挳
- var btnSave = new BottomClickButton();
- btnSave.TextID = R.MyInternationalizationString.uSave;
- bodyFrameLayout.AddChidren(btnSave);
+ selectTime = minute * 60 + second;
+ };
+
+ //瀹屾垚鎸夐挳
+ var btnSave = new BottomClickButton();
+ btnSave.TextID = R.MyInternationalizationString.uSave;
+ bodyFrameLayout.AddChidren(btnSave);
btnSave.ButtonClickEvent += (sender, e) =>
{
//閫夋嫨鐨勬槸鍚屼竴涓椂闂�,鍒欎笉瑙﹀彂鍥炶皟鍑芥暟
@@ -133,20 +143,20 @@
};
}
- #endregion
+ #endregion
- #region 鈻� 鐣岄潰鍏抽棴___________________________
-
+ #region 鈻� 鐣岄潰鍏抽棴___________________________
+
/// <summary>
/// 鐣岄潰鍏抽棴
- /// </summary>
+ /// </summary>
public override void CloseFormBefore()
{
this.FinishSelectEvent = null;
base.CloseFormBefore();
- }
-
- #endregion
- }
-}
+ }
+
+ #endregion
+ }
+}
--
Gitblit v1.8.0