| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using 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 ■ 初始化_____________________________
|
| | |
|
| | |
| | | //图标第一层底色
|
| | | 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;
|
| | |
| | | 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);
|
| | |
|
| | | int firstIndex = selectTime / 60;
|
| | |
| | | //因为0分的时候,它是从1秒开始的,所以它的索引需要-1
|
| | | if (firstIndex == 0) { secondIndex--; }
|
| | |
|
| | | pickView.setPicker(listfirst, listSecond); |
| | | pickView.setCurrentItems(firstIndex, secondIndex, 0); |
| | | pickView.OnSelectChangeEvent += (value1, value2, value3) => |
| | | 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) =>
|
| | | {
|
| | | //选择的是同一个时间,则不触发回调函数
|
| | |
| | | };
|
| | | }
|
| | |
|
| | | #endregion |
| | | #endregion
|
| | |
|
| | | #region ■ 界面关闭___________________________ |
| | | |
| | | #region ■ 界面关闭___________________________
|
| | |
|
| | | /// <summary>
|
| | | /// 界面关闭
|
| | | /// </summary> |
| | | /// </summary>
|
| | | public override void CloseFormBefore()
|
| | | {
|
| | | this.FinishSelectEvent = null;
|
| | |
|
| | | base.CloseFormBefore();
|
| | | } |
| | | |
| | | #endregion |
| | | } |
| | | } |
| | | }
|
| | |
|
| | | #endregion
|
| | | }
|
| | | }
|