using System; using Shared.Common; namespace Shared.Phone.Device.Logic.LogicView { public class TipView { public void ShowTip(FrameLayout fLayout) { FrameLayout tipFLayout = new FrameLayout { X = Application.GetRealWidth(144), Y = Application.GetRealHeight(706), Width = Application.GetRealWidth(792), Height = Application.GetRealHeight(351 + 127), BackgroundColor = ZigbeeColor.Current.LogicBlankBackgroundColor, }; fLayout.AddChidren(tipFLayout); tipFLayout.SetCornerWithSameRadius(Application.GetRealHeight(17), HDLUtils.RectCornerTopLeft| HDLUtils.RectCornerTopRight| HDLUtils.RectCornerBottomLeft| HDLUtils.RectCornerBottomRight); FrameLayout topFrame = new FrameLayout { Width = Application.GetRealWidth(792), Height = Application.GetRealHeight(351), }; tipFLayout.AddChidren(topFrame); Button tipBtn = new Button { TextID = R.MyInternationalizationString.Tip, TextAlignment = TextAlignment.Center, TextColor = ZigbeeColor.Current.LogicTipColor, TextSize = 16, Y = Application.GetRealHeight(69), X = Application.GetRealWidth(150), Height = Application.GetRealHeight(63), Width = Application.GetRealWidth(492), }; topFrame.AddChidren(tipBtn); Button tipTextBtn = new Button { Text=Language.StringByID(R.MyInternationalizationString.SetDoorLockNomallyOpen).Replace("{0}", "\r\n"), TextAlignment = TextAlignment.Center, TextColor = ZigbeeColor.Current.LogicTipTextColor, TextSize = 14, Y = tipBtn.Bottom + Application.GetRealHeight(35), X = Application.GetRealWidth(60), Height = Application.GetRealHeight(115), Width = Application.GetRealWidth(674), IsMoreLines = true, }; topFrame.AddChidren(tipTextBtn); FrameLayout bottomFrame = new FrameLayout { Y = topFrame.Bottom, Width = Application.GetRealWidth(792), Height = Application.GetRealHeight(127), }; tipFLayout.AddChidren(bottomFrame); Button cancelBtn = new Button { TextAlignment = TextAlignment.Center, TextColor = ZigbeeColor.Current.LogicBtnCancelColor, TextSize = 14, Height = Application.GetRealHeight(127), Width = Application.GetRealWidth(397), BackgroundColor = ZigbeeColor.Current.LogicMiddleBackgroundColor, Text="123", }; bottomFrame.AddChidren(cancelBtn); cancelBtn.SetCornerWithSameRadius(Application.GetRealHeight(17), HDLUtils.RectCornerTopLeft ); Button okBtn = new Button { TextAlignment = TextAlignment.Center, TextColor = ZigbeeColor.Current.LogicBlankBackgroundColor, TextSize = 14, X = cancelBtn.Right, Height = Application.GetRealHeight(127), Width = bottomFrame.Width- cancelBtn.Width, BackgroundColor = ZigbeeColor.Current.LogicBtnTypeColor, Text = "456", }; bottomFrame.AddChidren(okBtn); okBtn.SetCornerWithSameRadius(Application.GetRealHeight(17), HDLUtils.RectCornerBottomRight); cancelBtn.MouseUpEventHandler += (sender,e) => { fLayout.RemoveFromParent(); }; } } }