| | |
| | | |
| | | namespace Shared.Phone.Device.CommonForm |
| | | { |
| | | public class SelectTime: UserCenter.FrameLayoutBase |
| | | public class SelectTime : FrameLayoutBase |
| | | { |
| | | public Action<int> TimeAction; |
| | | |
| | | Button TempSelectBtn; |
| | | |
| | | |
| | | Button TempTimeBtn; |
| | | |
| | | public int TempTime; |
| | |
| | | |
| | | var cancle = new Button |
| | | { |
| | | X=Application.GetRealWidth(80), |
| | | Width=Application.GetRealWidth(300), |
| | | X = Application.GetRealWidth(80), |
| | | Width = Application.GetRealWidth(300), |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | TextColor = ZigbeeColor.Current.GXCTextGrayColor, |
| | | TextID=R.MyInternationalizationString.Cancel, |
| | | TextSize=14 |
| | | TextID = R.MyInternationalizationString.Cancel, |
| | | TextSize = 14 |
| | | }; |
| | | topView.AddChidren(cancle); |
| | | |
| | | var title = new Button |
| | | { |
| | | Width = Application.GetRealWidth(300), |
| | | Gravity=Gravity.CenterHorizontal, |
| | | Gravity = Gravity.CenterHorizontal, |
| | | TextColor = ZigbeeColor.Current.GXCTextBlackColor2, |
| | | TextID=R.MyInternationalizationString.Delay, |
| | | TextID = R.MyInternationalizationString.Delay, |
| | | TextSize = 16 |
| | | }; |
| | | topView.AddChidren(title); |
| | | |
| | | var confrim=new Button |
| | | var confrim = new Button |
| | | { |
| | | X = Application.GetRealWidth(CommonFormResouce.AppRealWidth-80-300), |
| | | X = dialog.Width - Application.GetRealWidth(80 - 300), |
| | | Width = Application.GetRealWidth(300), |
| | | TextAlignment = TextAlignment.CenterRight, |
| | | TextColor = ZigbeeColor.Current.GXCTextSelectedColor2, |
| | |
| | | var timeLayout = new VerticalScrolViewLayout |
| | | { |
| | | Y = Application.GetRealHeight(207), |
| | | Height = Application.GetRealHeight(703 + 127 * 2 + 12+12), |
| | | Height = Application.GetRealHeight(703 + 127 * 2 + 12 + 12), |
| | | ScrollEnabled = false, |
| | | VerticalScrollBarEnabled = false, |
| | | }; |
| | |
| | | var notOpen = new Button |
| | | { |
| | | X = Application.GetRealWidth(80), |
| | | Y=Application.GetRealHeight(1200), |
| | | Width=Application.GetRealWidth(800), |
| | | Height=Application.GetRealHeight(80), |
| | | Y = Application.GetRealHeight(1200), |
| | | Width = Application.GetRealWidth(800), |
| | | Height = Application.GetRealHeight(80), |
| | | TextColor = ZigbeeColor.Current.GXCTextGrayColor4, |
| | | TextID = R.MyInternationalizationString.NotOpen, |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | TextSize=14 |
| | | TextSize = 14 |
| | | }; |
| | | backgroundFL.AddChidren(notOpen); |
| | | |
| | |
| | | tList.Add(60 * 30); |
| | | tList.Add(60 * 60); |
| | | |
| | | foreach(var t in tList) |
| | | foreach (var t in tList) |
| | | { |
| | | AddTime(timeLayout, t); |
| | | } |
| | |
| | | { |
| | | var row = new FrameLayout |
| | | { |
| | | Height = Application.GetRealHeight(127+12), |
| | | Height = Application.GetRealHeight(127 + 12), |
| | | BackgroundColor = ZigbeeColor.Current.GXCBackgroundColor |
| | | }; |
| | | verticalScrolView.AddChidren(row); |
| | | |
| | | var trow = new FrameLayout |
| | | { |
| | | Y=Application.GetRealHeight(12), |
| | | Y = Application.GetRealHeight(12), |
| | | Height = Application.GetRealHeight(127), |
| | | BackgroundColor=ZigbeeColor.Current.GXCBackgroundColor |
| | | BackgroundColor = ZigbeeColor.Current.GXCBackgroundColor |
| | | }; |
| | | row.AddChidren(trow); |
| | | |
| | | var timeBtn = new Button |
| | | { |
| | | X = Application.GetRealWidth(80), |
| | | Width=Application.GetRealWidth(500), |
| | | Width = Application.GetRealWidth(500), |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | TextColor = ZigbeeColor.Current.GXCTextGrayColor4, |
| | | SelectedTextColor = ZigbeeColor.Current.GXCTextBlackColor, |
| | | IsSelected=false, |
| | | TextSize=14 |
| | | IsSelected = false, |
| | | TextSize = 14 |
| | | }; |
| | | trow.AddChidren(timeBtn); |
| | | |
| | |
| | | { |
| | | X = Application.GetRealWidth(942), |
| | | Width = this.GetPictrueRealSize(60), |
| | | Height=this.GetPictrueRealSize(60), |
| | | Gravity=Gravity.CenterVertical, |
| | | UnSelectedImagePath="Item/ItemSelected.png", |
| | | Visible=false |
| | | Height = this.GetPictrueRealSize(60), |
| | | Gravity = Gravity.CenterVertical, |
| | | UnSelectedImagePath = "Item/ItemSelected.png", |
| | | Visible = false |
| | | }; |
| | | trow.AddChidren(selectBtn); |
| | | |
| | |
| | | Y = row.Height - 1, |
| | | Width = Application.GetRealWidth(919), |
| | | Height = 1, |
| | | Gravity=Gravity.CenterHorizontal, |
| | | Gravity = Gravity.CenterHorizontal, |
| | | BackgroundColor = Common.ZigbeeColor.Current.GXCGrayLineColor2 |
| | | }; |
| | | row.AddChidren(Line); |
| | | |
| | | |
| | | |
| | | EventHandler<MouseEventArgs> eventHandler = (sender, e) => |
| | | { |
| | | TempTimeBtn.IsSelected = false; |
| | |
| | | timeBtn.MouseUpEventHandler += eventHandler; |
| | | trow.MouseUpEventHandler += eventHandler; |
| | | |
| | | timeBtn.Text =CommonFormResouce.GetTimeString(timess); |
| | | timeBtn.Text = this.GetTimeString(timess); |
| | | |
| | | if (timess == TempTime) |
| | | { |
| | |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 获取场景延时字符串 |
| | | /// </summary> |
| | | /// <param name="second"></param> |
| | | /// <returns></returns> |
| | | private string GetTimeString(int second) |
| | | { |
| | | if (second == 0) |
| | | { |
| | | return null; |
| | | } |
| | | string timeStr = string.Empty; |
| | | int hour = second / 3600; |
| | | int minu = second % 3600 / 60; |
| | | int sec = second % 60; |
| | | if (hour > 0) |
| | | { |
| | | timeStr += $"{hour}{Language.StringByID(R.MyInternationalizationString.Hour)}"; |
| | | if (minu > 0) |
| | | { |
| | | timeStr += $"{minu}{Language.StringByID(R.MyInternationalizationString.Minute)}"; |
| | | } |
| | | if (sec > 0) |
| | | { |
| | | timeStr += $"{sec}{Language.StringByID(R.MyInternationalizationString.Second)}"; |
| | | } |
| | | return timeStr; |
| | | } |
| | | else if (minu > 0) |
| | | { |
| | | timeStr += $"{minu}{Language.StringByID(R.MyInternationalizationString.Minute)}"; |
| | | if (sec > 0) |
| | | { |
| | | timeStr += $"{sec}{Language.StringByID(R.MyInternationalizationString.Second)}"; |
| | | } |
| | | return timeStr; |
| | | } |
| | | else |
| | | { |
| | | return $"{sec}{Language.StringByID(R.MyInternationalizationString.Second)}"; |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// Close |
| | | /// </summary> |
| | | /// <param name="sender"></param> |
| | | /// <param name="mouseEventArgs"></param> |
| | | private void Close(object sender,MouseEventArgs mouseEventArgs) |
| | | private void Close(object sender, MouseEventArgs mouseEventArgs) |
| | | { |
| | | RemoveFromParent(); |
| | | } |
| | |
| | | /// </summary> |
| | | /// <param name="sender"></param> |
| | | /// <param name="mouseEventArgs"></param> |
| | | private void Confrim_MouseEvent(object sender,MouseEventArgs mouseEventArgs) |
| | | private void Confrim_MouseEvent(object sender, MouseEventArgs mouseEventArgs) |
| | | { |
| | | TimeAction.Invoke(TempTime); |
| | | RemoveFromParent(); |
| | |
| | | /// </summary> |
| | | /// <param name="sender"></param> |
| | | /// <param name="mouseEventArgs"></param> |
| | | private void NotOpen_MouseEvent(object sender,MouseEventArgs mouseEventArgs) |
| | | private void NotOpen_MouseEvent(object sender, MouseEventArgs mouseEventArgs) |
| | | { |
| | | TimeAction.Invoke(0); |
| | | RemoveFromParent(); |
| | | } |
| | | |
| | | |
| | | } |
| | | } |