| | |
| | | |
| | | Function device; |
| | | FaceUnlockSetupObj faceUnlockSetup; |
| | | public VideoDoorlockFaceUnlockTriggerSettingPage(Function function,FaceUnlockSetupObj setupObj) |
| | | Action<int> updataAction; |
| | | public VideoDoorlockFaceUnlockTriggerSettingPage(Function function,FaceUnlockSetupObj setupObj,Action<int> action) |
| | | { |
| | | updataAction = action; |
| | | bodyView = this; |
| | | device = function; |
| | | faceUnlockSetup = setupObj; |
| | |
| | | Y = Application.GetRealHeight(20), |
| | | Width = Application.GetRealWidth(164), |
| | | Height = Application.GetRealWidth(60), |
| | | Radius = (uint)Application.GetRealWidth(30), |
| | | Radius = (uint)Application.GetRealWidth(12), |
| | | BackgroundColor = faceUnlockSetup.mode == 0 ? CSS_Color.MainColor : CSS_Color.MainBackgroundColor, |
| | | BorderColor = CSS_Color.MainColor, |
| | | BorderWidth = 1, |
| | | }; |
| | | contentView.AddChidren(autoView); |
| | | |
| | |
| | | var btnAutoText = new Button |
| | | { |
| | | X = btnAutoIcon.Right + Application.GetRealWidth(4), |
| | | Width = Application.GetRealWidth(50), |
| | | Width = Application.GetRealWidth(90), |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | TextSize = CSS_FontSize.HeadlineFontSize, |
| | | TextColor = faceUnlockSetup.mode == 1 ? CSS_Color.MainColor : CSS_Color.MainBackgroundColor, |
| | | TextID = StringId.AutomaticTriggering, |
| | | }; |
| | | autoView.AddChidren(btnAutoText); |
| | | |
| | |
| | | #region 手动触发 |
| | | var manualView = new FrameLayout() |
| | | { |
| | | X = Application.GetRealWidth(16), |
| | | X = Application.GetRealWidth(196), |
| | | Y = Application.GetRealHeight(20), |
| | | Width = Application.GetRealWidth(164), |
| | | Height = Application.GetRealWidth(60), |
| | | Radius = (uint)Application.GetRealWidth(30), |
| | | Radius = (uint)Application.GetRealWidth(12), |
| | | BackgroundColor = faceUnlockSetup.mode == 1 ? CSS_Color.MainColor : CSS_Color.MainBackgroundColor, |
| | | BorderColor = CSS_Color.MainColor, |
| | | BorderWidth = 1, |
| | | }; |
| | | contentView.AddChidren(manualView); |
| | | |
| | |
| | | var btnManualText = new Button |
| | | { |
| | | X = btnManualIcon.Right + Application.GetRealWidth(4), |
| | | Width = Application.GetRealWidth(50), |
| | | Width = Application.GetRealWidth(90), |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | TextSize = CSS_FontSize.HeadlineFontSize, |
| | | TextColor = faceUnlockSetup.mode == 0 ? CSS_Color.MainColor : CSS_Color.MainBackgroundColor, |
| | | TextID = StringId.ManualTriggering, |
| | | }; |
| | | manualView.AddChidren(btnManualText); |
| | | btnManualText.MouseUpEventHandler = (sender, e) => { |
| | | |
| | | }; |
| | | #endregion |
| | | |
| | | |
| | |
| | | btnAutoText.TextColor = CSS_Color.MainBackgroundColor; |
| | | manualView.BackgroundColor = CSS_Color.MainBackgroundColor; |
| | | btnManualIcon.UnSelectedImagePath = "FunctionIcon/DoorLock/ManualTriggerIcon_blue.png"; |
| | | btnAutoText.TextColor = CSS_Color.MainColor; |
| | | |
| | | btnManualText.TextColor = CSS_Color.MainColor; |
| | | automaitcTipView.Visible = true; |
| | | manualTipView.Visible = false; |
| | | updataAction?.Invoke(0); |
| | | }); |
| | | } |
| | | else |
| | |
| | | //失败提示 |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | if (!string.IsNullOrEmpty(pack.message)) |
| | | if (string.IsNullOrEmpty(pack.message)) |
| | | { |
| | | pack.message = Language.StringByID(StringId.OperationFailed); |
| | | } |
| | | { |
| | | var tip = new Tip() |
| | | { |
| | |
| | | btnAutoText.TextColor = CSS_Color.MainColor; |
| | | manualView.BackgroundColor = CSS_Color.MainColor; |
| | | btnManualIcon.UnSelectedImagePath = "FunctionIcon/DoorLock/ManualTriggerIcon_white.png"; |
| | | btnAutoText.TextColor = CSS_Color.MainBackgroundColor; |
| | | btnManualText.TextColor = CSS_Color.MainBackgroundColor; |
| | | automaitcTipView.Visible = false; |
| | | manualTipView.Visible = true; |
| | | updataAction?.Invoke(1); |
| | | |
| | | }); |
| | | } |
| | |
| | | //失败提示 |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | if (!string.IsNullOrEmpty(pack.message)) |
| | | if (string.IsNullOrEmpty(pack.message)) |
| | | { |
| | | pack.message = Language.StringByID(StringId.OperationFailed); |
| | | } |
| | | { |
| | | var tip = new Tip() |
| | | { |
| | |
| | | |
| | | if(faceUnlockSetup.mode == 0) |
| | | { |
| | | automaitcView.Visible = true; |
| | | manualView.Visible = false; |
| | | automaitcTipView.Visible = true; |
| | | manualTipView.Visible = false; |
| | | } |
| | | else |
| | | { |
| | | automaitcView.Visible = false; |
| | | manualView.Visible = true; |
| | | automaitcTipView.Visible = false; |
| | | manualTipView.Visible = true; |
| | | } |
| | | |
| | | } |
| | | FrameLayout automaitcView; |
| | | FrameLayout manualView; |
| | | FrameLayout automaitcTipView; |
| | | FrameLayout manualTipView; |
| | | |
| | | /// <summary> |
| | | /// 加载自动触发方式提示 |
| | | /// </summary> |
| | | void loadAutomaitcTipView() |
| | | { |
| | | automaitcView = new FrameLayout() |
| | | automaitcTipView = new FrameLayout() |
| | | { |
| | | Y = Application.GetRealHeight(128), |
| | | Y = Application.GetRealHeight(128 + 64), |
| | | Height = Application.GetRealHeight(667 - 128 - 64), |
| | | BackgroundColor = CSS_Color.MainBackgroundColor |
| | | }; |
| | | bodyView.AddChidren(automaitcView); |
| | | bodyView.AddChidren(automaitcTipView); |
| | | |
| | | var btnAutomaitcImage = new Button() |
| | | { |
| | |
| | | Height = Application.GetRealWidth(200), |
| | | UnSelectedImagePath = "FunctionIcon/DoorLock/FaceUnlockImage.png", |
| | | }; |
| | | automaitcView.AddChidren(btnAutomaitcImage); |
| | | automaitcTipView.AddChidren(btnAutomaitcImage); |
| | | |
| | | var btnAutomaitcTip = new Button() |
| | | { |
| | |
| | | IsMoreLines = true, |
| | | TextID = StringId.FaceUnlockTip |
| | | }; |
| | | automaitcView.AddChidren(btnAutomaitcTip); |
| | | automaitcTipView.AddChidren(btnAutomaitcTip); |
| | | |
| | | var btnAutomaitcNote = new Button() |
| | | { |
| | |
| | | TextSize = CSS_FontSize.PromptFontSize_FirstLevel, |
| | | TextColor = CSS_Color.PromptingColor1, |
| | | TextID = StringId.FaceUnlockNote, |
| | | IsMoreLines = true, |
| | | }; |
| | | automaitcView.AddChidren(btnAutomaitcNote); |
| | | automaitcTipView.AddChidren(btnAutomaitcNote); |
| | | |
| | | } |
| | | /// <summary> |
| | |
| | | /// </summary> |
| | | void loadManualTipView() |
| | | { |
| | | manualView = new FrameLayout() |
| | | manualTipView = new FrameLayout() |
| | | { |
| | | Y = Application.GetRealHeight(128), |
| | | Y = Application.GetRealHeight(128 + 64), |
| | | Height = Application.GetRealHeight(667 - 128 - 64), |
| | | BackgroundColor = CSS_Color.MainBackgroundColor |
| | | }; |
| | | bodyView.AddChidren(manualView); |
| | | bodyView.AddChidren(manualTipView); |
| | | |
| | | var btnNumber1 = new Button() |
| | | { |
| | | X = Application.GetRealWidth(84), |
| | | //Y = Application.GetRealHeight() |
| | | Width = Application.GetRealWidth(24), |
| | | Height = Application.GetRealWidth(24), |
| | | Radius = (uint)Application.GetRealWidth(12), |
| | | BorderColor = CSS_Color.MainColor, |
| | | BorderWidth = 1, |
| | | TextSize = CSS_FontSize.SubheadingFontSize, |
| | | TextColor = CSS_Color.MainColor, |
| | | TextAlignment = TextAlignment.Center, |
| | | Text = "1", |
| | | }; |
| | | manualTipView.AddChidren(btnNumber1); |
| | | |
| | | var btnNumber2 = new Button() |
| | | { |
| | | X = Application.GetRealWidth(267), |
| | | //Y = Application.GetRealHeight() |
| | | Width = Application.GetRealWidth(24), |
| | | Height = Application.GetRealWidth(24), |
| | | Radius = (uint)Application.GetRealWidth(12), |
| | | BorderColor = CSS_Color.MainColor, |
| | | BorderWidth = 1, |
| | | TextSize = CSS_FontSize.SubheadingFontSize, |
| | | TextColor = CSS_Color.MainColor, |
| | | TextAlignment = TextAlignment.Center, |
| | | Text = "2", |
| | | }; |
| | | manualTipView.AddChidren(btnNumber2); |
| | | |
| | | var btnImage1 = new Button() |
| | | { |
| | | X = Application.GetRealWidth(16), |
| | | Y = Application.GetRealHeight(31), |
| | | Gravity = Gravity.CenterHorizontal, |
| | | Width = Application.GetRealWidth(160), |
| | | Height = Application.GetRealWidth(160), |
| | | UnSelectedImagePath = "FunctionIcon/DoorLock/TouchUnlcokImage.png", |
| | | }; |
| | | manualView.AddChidren(btnImage1); |
| | | manualTipView.AddChidren(btnImage1); |
| | | |
| | | var btnAutomaitcImage = new Button() |
| | | { |
| | | X = btnImage1.Right + Application.GetRealWidth(24), |
| | | Y = Application.GetRealHeight(31), |
| | | Gravity = Gravity.CenterHorizontal, |
| | | Width = Application.GetRealWidth(160), |
| | | Height = Application.GetRealWidth(160), |
| | | UnSelectedImagePath = "FunctionIcon/DoorLock/FaceUnlockImage.png", |
| | | }; |
| | | manualView.AddChidren(btnAutomaitcImage); |
| | | manualTipView.AddChidren(btnAutomaitcImage); |
| | | |
| | | var btnManualTip = new Button() |
| | | { |
| | |
| | | IsMoreLines = true, |
| | | TextID = StringId.FaceManualUnlockTip |
| | | }; |
| | | manualView.AddChidren(btnManualTip); |
| | | manualTipView.AddChidren(btnManualTip); |
| | | } |
| | | } |
| | | } |