| | |
| | | { |
| | | #region 控件列表 |
| | | FrameLayout bodyView; |
| | | |
| | | /// <summary> |
| | | /// 上部分显示区域 |
| | | /// </summary> |
| | | FrameLayout topContentView; |
| | | /// <summary> |
| | | /// 解锁页面选择列表view |
| | | /// </summary> |
| | | HorizontalScrolViewLayout optionView; |
| | | |
| | | /// <summary> |
| | | /// 无保护选项提示 |
| | | /// </summary> |
| | |
| | | Button btnTipMsg; |
| | | |
| | | /// <summary> |
| | | /// 解锁方式区域view |
| | | /// </summary> |
| | | VerticalScrolViewLayout unlockOptionView; |
| | | |
| | | /// <summary> |
| | | /// 密码设置文本 |
| | | /// 事件跳转按钮 |
| | | /// </summary> |
| | | Button btnPasswordUnlockTitle; |
| | | /// <summary> |
| | | /// 修改密码文本 |
| | | /// 事件跳转按钮 |
| | | /// </summary> |
| | | Button btnResetPasswordTitle; |
| | | |
| | | /// <summary> |
| | | /// 手势设置文本 |
| | | /// 事件跳转按钮 |
| | | /// </summary> |
| | | Button btnGestureUnlockTitle; |
| | | /// <summary> |
| | | /// 修改手势密码 |
| | | /// 事件跳转按钮 |
| | | /// </summary> |
| | | Button btnResetGestureTitle; |
| | | |
| | | /// <summary> |
| | | /// 指纹设置文本 |
| | | /// 事件跳转按钮 |
| | | /// </summary> |
| | | Button btnFingerprintUnlockSwtichIcon; |
| | | /// <summary> |
| | | /// 面容ID设置文本 |
| | | /// 事件跳转按钮 |
| | | /// </summary> |
| | | Button btnFaceIdUnlockSwtichIcon; |
| | | |
| | | |
| | | /// <summary> |
| | | /// 指纹解锁方式Row |
| | | /// </summary> |
| | | FrameLayout fingerprintUnlockDiv; |
| | | /// <summary> |
| | | /// 面容解锁方式Row |
| | | /// </summary> |
| | | FrameLayout faceIdUnlockDiv; |
| | | #endregion |
| | | |
| | | /// <summary> |
| | | /// 是否支持指纹解锁 |
| | | /// </summary> |
| | | bool sTouchID = false; |
| | | /// <summary> |
| | | /// 是否支持面容解锁 |
| | | /// </summary> |
| | | bool sFaceID = false; |
| | | |
| | | public AppUnlockSettingsPage() |
| | | { |
| | |
| | | public void LoadPage() |
| | | { |
| | | bodyView.BackgroundColor = CSS_Color.BackgroundColor; |
| | | new TopViewDiv(bodyView, Language.StringByID(StringId.InterpretationSettings)).LoadTopView(); |
| | | //如果用户配置了需要解锁的界面但是没有设置密码,则在返回时清空需要解锁的界面 |
| | | Action action = () => { |
| | | if(MainPage.LoginUser.appUnlockPage.Count > 0&& MainPage.LoginUser.appUnlockPasswrod == "") |
| | | { |
| | | MainPage.LoginUser.appUnlockPage = new System.Collections.Generic.List<string>(); |
| | | MainPage.LoginUser.SaveUserInfo(); |
| | | } |
| | | }; |
| | | new TopViewDiv(bodyView, Language.StringByID(StringId.InterpretationSettings)).LoadTopView(action); |
| | | |
| | | FrameLayout topContentView = new FrameLayout() |
| | | topContentView = new FrameLayout() |
| | | { |
| | | Y = Application.GetRealHeight(64), |
| | | Height = Application.GetRealWidth(332), |
| | |
| | | |
| | | Button btnTip1 = new Button() |
| | | { |
| | | Y = Application.GetRealHeight( 8), |
| | | Y = Application.GetRealHeight(8), |
| | | Height = Application.GetRealHeight(30), |
| | | TextAlignment = TextAlignment.Center, |
| | | IsBold = true, |
| | |
| | | topContentView.AddChidren(btnTip2); |
| | | |
| | | |
| | | var optionView = new HorizontalScrolViewLayout() |
| | | optionView = new HorizontalScrolViewLayout() |
| | | { |
| | | Y = Application.GetRealWidth(143-64), |
| | | Y = Application.GetRealWidth(143 - 64), |
| | | Height = Application.GetRealWidth(209), |
| | | BackgroundColor = CSS_Color.MainBackgroundColor, |
| | | }; |
| | | topContentView.AddChidren(optionView); |
| | | |
| | | LoadView_OptionView(optionView); |
| | | LoadView_OptionView(); |
| | | |
| | | btnTipMsg = new Button() |
| | | { |
| | |
| | | |
| | | LoadEventList(); |
| | | |
| | | if(MainPage.LoginUser.appUnlock.Count!=0) |
| | | { |
| | | LoadView_UnlockView(); |
| | | } |
| | | LoadView_UnlockView(); |
| | | |
| | | } |
| | | /// <summary> |
| | | /// 加载选项卡 |
| | | /// </summary> |
| | | void LoadView_OptionView(HorizontalScrolViewLayout optionView) |
| | | void LoadView_OptionView() |
| | | { |
| | | #region Unprotected |
| | | optionView.AddChidren(new Button() { Width = Application.GetRealWidth(24) }); |
| | |
| | | /// </summary> |
| | | void LoadView_UnlockView() |
| | | { |
| | | var unlockOptionView = new VerticalScrolViewLayout() |
| | | if(unlockOptionView!= null) |
| | | { |
| | | Y = Application.GetRealWidth(340+64), |
| | | Height = Application.GetRealWidth(260), |
| | | unlockOptionView.RemoveAll(); |
| | | } |
| | | unlockOptionView = new VerticalScrolViewLayout() |
| | | { |
| | | Y = topContentView.Bottom + Application.GetRealHeight(8), |
| | | Height = Application.GetRealHeight(260), |
| | | BackgroundColor = CSS_Color.MainBackgroundColor, |
| | | ScrollEnabled = false, |
| | | Visible = MainPage.LoginUser.appUnlockPage.Count > 0 |
| | | }; |
| | | bodyView.AddChidren(unlockOptionView); |
| | | |
| | | #region 标题栏 |
| | | var unlockTitleDiv = new FrameLayout() |
| | | { |
| | | Height = Application.GetRealWidth(59), |
| | | Height = Application.GetRealHeight(59), |
| | | }; |
| | | unlockOptionView.AddChidren(unlockTitleDiv); |
| | | |
| | |
| | | }; |
| | | unlockTitleDiv.AddChidren(btnUnlockTitleTip); |
| | | |
| | | unlockOptionView.AddChidren(new Button() { |
| | | X = Application.GetRealWidth(16), |
| | | unlockOptionView.AddChidren(new Button() |
| | | { |
| | | X = Application.GetRealWidth(16), |
| | | Width = Application.GetRealWidth(359), |
| | | Height = 1, |
| | | BackgroundColor = CSS_Color.BackgroundColor, |
| | |
| | | #region 密码解锁 |
| | | var passwordUnlockDiv = new FrameLayout() |
| | | { |
| | | Height = Application.GetRealWidth(50), |
| | | Height = Application.GetRealHeight(50), |
| | | }; |
| | | unlockOptionView.AddChidren(passwordUnlockDiv); |
| | | if ( !MainPage.LoginUser.appUnlockType.Contains("2")) |
| | | { |
| | | unlockOptionView.AddChidren(passwordUnlockDiv); |
| | | } |
| | | |
| | | var btnPasswordUnlockIcon = new Button() |
| | | { |
| | |
| | | }; |
| | | passwordUnlockDiv.AddChidren(btnPasswordUnlockIcon); |
| | | |
| | | var btnPasswordUnlockRightIcon = new Button() |
| | | //var btnPasswordUnlockRightIcon = new Button() |
| | | //{ |
| | | // X = Application.GetRealWidth(339), |
| | | // Gravity = Gravity.CenterVertical, |
| | | // Width = Application.GetMinRealAverage(16), |
| | | // Height = Application.GetMinRealAverage(16), |
| | | // UnSelectedImagePath = "Public/Right.png", |
| | | //}; |
| | | //passwordUnlockDiv.AddChidren(btnPasswordUnlockRightIcon); |
| | | |
| | | |
| | | var btnPasswordUnlockkSwtichIcon = new Button() |
| | | { |
| | | X = Application.GetRealWidth(339), |
| | | X = Application.GetRealWidth(322), |
| | | Gravity = Gravity.CenterVertical, |
| | | Width = Application.GetMinRealAverage(16), |
| | | Height = Application.GetMinRealAverage(16), |
| | | UnSelectedImagePath = "Public/Right.png", |
| | | Width = Application.GetMinRealAverage(38), |
| | | Height = Application.GetMinRealAverage(38), |
| | | UnSelectedImagePath = "Public/Switch_2.png", |
| | | SelectedImagePath = "Public/SwitchOn_2.png", |
| | | IsSelected = MainPage.LoginUser.appUnlockType.Contains("1") |
| | | }; |
| | | passwordUnlockDiv.AddChidren(btnPasswordUnlockRightIcon); |
| | | passwordUnlockDiv.AddChidren(btnPasswordUnlockkSwtichIcon); |
| | | |
| | | btnPasswordUnlockTitle = new Button() |
| | | { |
| | |
| | | TextID = StringId.PasswordUnlock, |
| | | }; |
| | | passwordUnlockDiv.AddChidren(btnPasswordUnlockTitle); |
| | | |
| | | unlockOptionView.AddChidren(new Button() { |
| | | X = Application.GetRealWidth(16), |
| | | |
| | | unlockOptionView.AddChidren(new Button() |
| | | { |
| | | X = Application.GetRealWidth(16), |
| | | Width = Application.GetRealWidth(343), |
| | | Height = 1, |
| | | BackgroundColor = CSS_Color.BackgroundColor, |
| | | }); |
| | | #endregion |
| | | |
| | | #region 修改密码 |
| | | var resetPasswordDiv = new FrameLayout() |
| | | { |
| | | Height = Application.GetRealHeight(50), |
| | | }; |
| | | if (MainPage.LoginUser.appUnlockPasswrod != "" && MainPage.LoginUser.appUnlockType.Contains("1")) |
| | | { |
| | | unlockOptionView.AddChidren(resetPasswordDiv); |
| | | } |
| | | var btnPasswordUnlockRightIcon = new Button() |
| | | { |
| | | X = Application.GetRealWidth(339), |
| | | Gravity = Gravity.CenterVertical, |
| | | Width = Application.GetMinRealAverage(16), |
| | | Height = Application.GetMinRealAverage(16), |
| | | UnSelectedImagePath = "Public/Right.png", |
| | | }; |
| | | resetPasswordDiv.AddChidren(btnPasswordUnlockRightIcon); |
| | | |
| | | |
| | | btnResetPasswordTitle = new Button() |
| | | { |
| | | X = Application.GetRealWidth(66), |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | TextColor = CSS_Color.FirstLevelTitleColor, |
| | | TextSize = CSS_FontSize.TextFontSize, |
| | | TextID = StringId.ResetDigitalPassword, |
| | | }; |
| | | resetPasswordDiv.AddChidren(btnResetPasswordTitle); |
| | | |
| | | if (MainPage.LoginUser.appUnlockPasswrod != "" && MainPage.LoginUser.appUnlockType.Contains("1")) |
| | | { |
| | | unlockOptionView.AddChidren(new Button() |
| | | { |
| | | X = Application.GetRealWidth(16), |
| | | Width = Application.GetRealWidth(343), |
| | | Height = 1, |
| | | BackgroundColor = CSS_Color.BackgroundColor, |
| | | }); |
| | | } |
| | | #endregion |
| | | |
| | | #region 手势解锁 |
| | | var gestureUnlockDiv = new FrameLayout() |
| | | { |
| | | Height = Application.GetRealWidth(50), |
| | | Height = Application.GetRealHeight(50), |
| | | }; |
| | | unlockOptionView.AddChidren(gestureUnlockDiv); |
| | | |
| | | if (!MainPage.LoginUser.appUnlockType.Contains("1")) |
| | | { |
| | | unlockOptionView.AddChidren(gestureUnlockDiv); |
| | | } |
| | | var btnGestureUnlockIcon = new Button() |
| | | { |
| | | X = Application.GetRealWidth(16), |
| | |
| | | }; |
| | | gestureUnlockDiv.AddChidren(btnGestureUnlockIcon); |
| | | |
| | | var btnGestureUnlockRightIcon = new Button() |
| | | //var btnGestureUnlockRightIcon = new Button() |
| | | //{ |
| | | // X = Application.GetRealWidth(339), |
| | | // Gravity = Gravity.CenterVertical, |
| | | // Width = Application.GetMinRealAverage(16), |
| | | // Height = Application.GetMinRealAverage(16), |
| | | // UnSelectedImagePath = "Public/Right.png", |
| | | //}; |
| | | //gestureUnlockDiv.AddChidren(btnGestureUnlockRightIcon); |
| | | |
| | | var btnGestureUnlockkSwtichIcon = new Button() |
| | | { |
| | | X = Application.GetRealWidth(322), |
| | | Gravity = Gravity.CenterVertical, |
| | | Width = Application.GetMinRealAverage(38), |
| | | Height = Application.GetMinRealAverage(38), |
| | | UnSelectedImagePath = "Public/Switch_2.png", |
| | | SelectedImagePath = "Public/SwitchOn_2.png", |
| | | IsSelected = MainPage.LoginUser.appUnlockType.Contains("2") |
| | | }; |
| | | gestureUnlockDiv.AddChidren(btnGestureUnlockkSwtichIcon); |
| | | |
| | | |
| | | btnGestureUnlockTitle = new Button() |
| | | { |
| | | X = Application.GetRealWidth(66), |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | TextColor = CSS_Color.FirstLevelTitleColor, |
| | | TextSize = CSS_FontSize.TextFontSize, |
| | | TextID = StringId.GestureUnlock, |
| | | }; |
| | | gestureUnlockDiv.AddChidren(btnGestureUnlockTitle); |
| | | |
| | | if (!MainPage.LoginUser.appUnlockType.Contains("1")) |
| | | { |
| | | unlockOptionView.AddChidren(new Button() |
| | | { |
| | | X = Application.GetRealWidth(16), |
| | | Width = Application.GetRealWidth(343), |
| | | Height = 1, |
| | | BackgroundColor = CSS_Color.BackgroundColor, |
| | | }); |
| | | } |
| | | #endregion |
| | | |
| | | |
| | | #region 修改手势 |
| | | var resetGestureDiv = new FrameLayout() |
| | | { |
| | | Height = Application.GetRealHeight(50), |
| | | }; |
| | | if (MainPage.LoginUser.appUnlockPasswrod != "" && MainPage.LoginUser.appUnlockType.Contains("2")) |
| | | { |
| | | unlockOptionView.AddChidren(resetGestureDiv); |
| | | } |
| | | var btnGestureRightIcon = new Button() |
| | | { |
| | | X = Application.GetRealWidth(339), |
| | | Gravity = Gravity.CenterVertical, |
| | |
| | | Height = Application.GetMinRealAverage(16), |
| | | UnSelectedImagePath = "Public/Right.png", |
| | | }; |
| | | gestureUnlockDiv.AddChidren(btnGestureUnlockRightIcon); |
| | | resetGestureDiv.AddChidren(btnGestureRightIcon); |
| | | |
| | | var btnGestureUnlockTitle = new Button() |
| | | |
| | | btnResetGestureTitle = new Button() |
| | | { |
| | | X = Application.GetRealWidth(66), |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | TextColor = CSS_Color.FirstLevelTitleColor, |
| | | TextSize = CSS_FontSize.TextFontSize, |
| | | TextID = StringId.PasswordUnlock, |
| | | TextID = StringId.ResetGesturePassword, |
| | | }; |
| | | gestureUnlockDiv.AddChidren(btnGestureUnlockTitle); |
| | | resetGestureDiv.AddChidren(btnResetGestureTitle); |
| | | |
| | | unlockOptionView.AddChidren(new Button() { |
| | | X = Application.GetRealWidth(16), |
| | | Width = Application.GetRealWidth(343), |
| | | Height = 1, |
| | | BackgroundColor = CSS_Color.BackgroundColor, |
| | | }); |
| | | if (MainPage.LoginUser.appUnlockPasswrod != "" && MainPage.LoginUser.appUnlockType.Contains("2")) |
| | | { |
| | | unlockOptionView.AddChidren(new Button() |
| | | { |
| | | X = Application.GetRealWidth(16), |
| | | Width = Application.GetRealWidth(343), |
| | | Height = 1, |
| | | BackgroundColor = CSS_Color.BackgroundColor, |
| | | }); |
| | | } |
| | | #endregion |
| | | |
| | | #region 查询设备是否支持面容ID,指纹ID |
| | | TouchIDUtils.TouchIDSupperType type = TouchIDUtils.getTouchIDSupperType(); |
| | | if (type == TouchIDUtils.TouchIDSupperType.TouchID) |
| | | { |
| | | sTouchID = true; |
| | | MainPage.Log("KK:支持TouchID"); |
| | | } |
| | | else if (type == TouchIDUtils.TouchIDSupperType.FaceID) |
| | | { |
| | | sFaceID = true; |
| | | MainPage.Log("KK:支持FaceID"); |
| | | } |
| | | |
| | | #endregion |
| | | |
| | | #region 指纹解锁 |
| | | var fingerprintUnlockDiv = new FrameLayout() |
| | | fingerprintUnlockDiv = new FrameLayout() |
| | | { |
| | | Height = Application.GetRealWidth(50), |
| | | Height = Application.GetRealHeight(51), |
| | | }; |
| | | unlockOptionView.AddChidren(fingerprintUnlockDiv); |
| | | if (sTouchID && MainPage.LoginUser.appUnlockPasswrod != ""&&!MainPage.LoginUser.appUnlockType.Contains("4")) |
| | | { |
| | | unlockOptionView.AddChidren(fingerprintUnlockDiv); |
| | | } |
| | | |
| | | var btnFingerprintUnlockIcon = new Button() |
| | | { |
| | |
| | | }; |
| | | fingerprintUnlockDiv.AddChidren(btnFingerprintUnlockTitle); |
| | | |
| | | var btnFingerprintUnlockSwtichIcon = new Button() |
| | | btnFingerprintUnlockSwtichIcon = new Button() |
| | | { |
| | | X = Application.GetRealWidth(322), |
| | | Y = Application.GetRealHeight(4), |
| | | Width = Application.GetMinRealAverage(48), |
| | | Height = Application.GetMinRealAverage(36), |
| | | UnSelectedImagePath = "Public/Switch.png", |
| | | SelectedImagePath = "Public/SwitchOn.png", |
| | | Gravity = Gravity.CenterVertical, |
| | | Width = Application.GetMinRealAverage(38), |
| | | Height = Application.GetMinRealAverage(38), |
| | | UnSelectedImagePath = "Public/Switch_2.png", |
| | | SelectedImagePath = "Public/SwitchOn_2.png", |
| | | IsSelected = MainPage.LoginUser.appUnlockType.Contains("3") |
| | | }; |
| | | fingerprintUnlockDiv.AddChidren(btnFingerprintUnlockSwtichIcon); |
| | | |
| | | unlockOptionView.AddChidren(new Button() { |
| | | X = Application.GetRealWidth(16), |
| | | |
| | | fingerprintUnlockDiv.AddChidren(new Button() |
| | | { |
| | | X = Application.GetRealWidth(16), |
| | | Y = Application.GetRealHeight(50), |
| | | Width = Application.GetRealWidth(343), |
| | | Height = 1, |
| | | BackgroundColor = CSS_Color.BackgroundColor, |
| | | //Visible = sFaceID |
| | | }); |
| | | |
| | | #endregion |
| | | |
| | | |
| | | #region 面容ID解锁 |
| | | var faceIdUnlockDiv = new FrameLayout() |
| | | faceIdUnlockDiv = new FrameLayout() |
| | | { |
| | | Height = Application.GetRealWidth(50), |
| | | Height = Application.GetRealHeight(50), |
| | | }; |
| | | unlockOptionView.AddChidren(faceIdUnlockDiv); |
| | | |
| | | if (sFaceID && MainPage.LoginUser.appUnlockPasswrod != "" && !MainPage.LoginUser.appUnlockType.Contains("4")) |
| | | { |
| | | unlockOptionView.AddChidren(faceIdUnlockDiv); |
| | | } |
| | | var btnFaceIdUnlockIcon = new Button() |
| | | { |
| | | X = Application.GetRealWidth(16), |
| | |
| | | }; |
| | | faceIdUnlockDiv.AddChidren(btnFaceIdUnlockTitle); |
| | | |
| | | var btnFaceIdUnlockSwtichIcon = new Button() |
| | | btnFaceIdUnlockSwtichIcon = new Button() |
| | | { |
| | | X = Application.GetRealWidth(322), |
| | | Y = Application.GetRealHeight(4), |
| | | Width = Application.GetMinRealAverage(48), |
| | | Height = Application.GetMinRealAverage(36), |
| | | UnSelectedImagePath = "Public/Switch.png", |
| | | SelectedImagePath = "Public/SwitchOn.png", |
| | | Gravity= Gravity.CenterVertical, |
| | | Width = Application.GetMinRealAverage(38), |
| | | Height = Application.GetMinRealAverage(38), |
| | | UnSelectedImagePath = "Public/Switch_2.png", |
| | | SelectedImagePath = "Public/SwitchOn_2.png", |
| | | IsSelected = MainPage.LoginUser.appUnlockType.Contains("4") |
| | | }; |
| | | faceIdUnlockDiv.AddChidren(btnFaceIdUnlockSwtichIcon); |
| | | |
| | | #endregion |
| | | |
| | | |
| | | LoadEvet_SkipEventList(); |
| | | |
| | | } |