| | |
| | | var top = new TopFrameLayout(); |
| | | AddChidren(top); |
| | | top.InitTopview(); |
| | | top.SetTopTitle(R.MyInternationalizationString.AddScence); |
| | | top.SetTopTitle(R.MyInternationalizationString.AddDelayTime); |
| | | top.backButton.MouseUpEventHandler += (sender, e) => |
| | | { |
| | | RemoveFromParent(); |
| | |
| | | Height = Application.GetMinRealAverage(124), |
| | | Width = Application.GetMinRealAverage(124), |
| | | Gravity = Gravity.Center, |
| | | Radius = (uint)Application.GetRealHeight(124 / 2), |
| | | Radius = (uint)Application.GetRealHeight(58), |
| | | UnSelectedImagePath = "Item/Timer.png" |
| | | }; |
| | | bg1.AddChidren(timeImg); |
| | |
| | | Gravity = Gravity.CenterHorizontal, |
| | | TextID = R.MyInternationalizationString.SelectTimeForAction, |
| | | TextColor = ZigbeeColor.Current.GXCTextBlackColor, |
| | | TextSize=15, |
| | | IsMoreLines = true |
| | | }; |
| | | bodyFrameLayout.AddChidren(tip); |
| | |
| | | Y = Application.GetRealHeight(611), |
| | | Height = Application.GetRealHeight(1126), |
| | | BackgroundColor = ZigbeeColor.Current.GXCBackgroundColor, |
| | | Radius = (uint)Application.GetRealHeight(17), |
| | | Radius = (uint)Application.GetRealHeight(58), |
| | | }; |
| | | bodyFrameLayout.AddChidren(midFL); |
| | | |
| | |
| | | }; |
| | | timeFL.AddChidren(pickView); |
| | | |
| | | var minuList = new List<int> { }; |
| | | var secList = new List<int> { }; |
| | | var minuStrList = new List<string> { }; |
| | | var secStrList = new List<string> { }; |
| | | for (int i = 0; i < 60; i++) |
| | | //分 |
| | | 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++) |
| | | { |
| | | minuList.Add(i); |
| | | minuStrList.Add($"{i}{Language.StringByID(R.MyInternationalizationString.Minute)}"); |
| | | secList.Add(i); |
| | | secStrList.Add($"{i}{Language.StringByID(R.MyInternationalizationString.Second)}"); |
| | | 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); |
| | | } |
| | | |
| | | pickView.setNPicker(minuStrList, secStrList, null); |
| | | |
| | | //加一个60分钟吧 |
| | | listfirst.Add("60" + strMinute); |
| | | var listTemp2 = new List<string>() { "00" + strSecond }; |
| | | listSecond.Add(listTemp2);
|
| | |
|
| | | pickView.setPicker(listfirst, listSecond); |
| | | pickView.setCurrentItems(totalSecond / 60, totalSecond % 60, 0); |
| | | |
| | | pickView.OnSelectChangeEvent += (l1, l2, l3) => |
| | | { |
| | | totalSecond = minuList[l1] * 60 + secList[l2]; |
| | | pickView.OnSelectChangeEvent += (value1, value2, value3) => |
| | | {
|
| | | int minute = Convert.ToInt32(listfirst[value1].Substring(0, 2));
|
| | | int second = Convert.ToInt32(listSecond[value1][value2].Substring(0, 2));
|
| | | totalSecond = minute * 60 + second; |
| | | }; |
| | | |
| | | var confirmBtn = new CommonForm.CompleteButton(1656, 907, 127); |
| | |
| | | confirmBtn.SetTitle(R.MyInternationalizationString.Save); |
| | | confirmBtn.MouseUpEventHandler += (sender, e) => |
| | | { |
| | | sceneTargetDevice.DelayTime = totalSecond; |
| | | selectedTimeAction?.Invoke(sceneTargetDevice); |
| | | RemoveFromParent(); |
| | | if (totalSecond == 0) |
| | | { |
| | | RemoveFromParent(); |
| | | } |
| | | else |
| | | { |
| | | sceneTargetDevice.DelayTime = totalSecond; |
| | | selectedTimeAction?.Invoke(sceneTargetDevice); |
| | | RemoveFromParent(); |
| | | } |
| | | }; |
| | | } |
| | | |