From a2927467ebfa938a420f392deb6882b35570fd33 Mon Sep 17 00:00:00 2001
From: wxr <464027401@qq.com>
Date: 星期二, 01 十二月 2020 16:48:06 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/CJL-NEW'
---
HDL_ON/UI/UI2/4-PersonalCenter/UnlockSetting/AppUnlockSettingsPageBLL.cs | 326 ++++++++++++++++++++++++++++++++++++++++++++++--------
1 files changed, 278 insertions(+), 48 deletions(-)
diff --git a/HDL_ON/UI/UI2/4-PersonalCenter/UnlockSetting/AppUnlockSettingsPageBLL.cs b/HDL_ON/UI/UI2/4-PersonalCenter/UnlockSetting/AppUnlockSettingsPageBLL.cs
index 2e1b448..a32e3b5 100644
--- a/HDL_ON/UI/UI2/4-PersonalCenter/UnlockSetting/AppUnlockSettingsPageBLL.cs
+++ b/HDL_ON/UI/UI2/4-PersonalCenter/UnlockSetting/AppUnlockSettingsPageBLL.cs
@@ -5,10 +5,20 @@
{
public partial class AppUnlockSettingsPage
{
+ Action refreshAction;
void LoadEventList()
{
LoadEvent_OptionChange();
LoadEvent_InitOptionState();
+
+ refreshAction = () =>
+ {
+ LoadView_UnlockView();
+ //fingerprintUnlockDiv.Visible = sTouchID && (OnAppConfig.Instance.appUnlockType.Contains("1") || OnAppConfig.Instance.appUnlockType.Contains("2"));
+ //faceIdUnlockDiv.Visible = sFaceID && (OnAppConfig.Instance.appUnlockType.Contains("1") || OnAppConfig.Instance.appUnlockType.Contains("2"));
+ //btnFingerprintUnlockSwtichIcon.IsSelected = OnAppConfig.Instance.appUnlockType.Contains("3");
+ //btnFaceIdUnlockSwtichIcon.IsSelected = OnAppConfig.Instance.appUnlockType.Contains("4");
+ };
}
/// <summary>
@@ -16,82 +26,211 @@
/// </summary>
void LoadEvent_OptionChange()
{
- EventHandler< MouseEventArgs> eventHandler1 = (sender, e) => {
- btnUnprotectedBg.IsSelected = btnUnprotectedSelectionIcon.IsSelected = btnUnprotectedSelectionTip.IsSelected = true;
- btnStartupBg.IsSelected = btnStartupSelectionIcon.IsSelected = btnStartupSelectionTip.IsSelected = false;
- btnSecurityBg.IsSelected = btnSecuritySelectionIcon.IsSelected = btnSecuritySelectionTip.IsSelected = false;
- btnDoorlockBg.IsSelected = btnDoorlockSelectionIcon.IsSelected = btnDoorlockSelectionTip.IsSelected = false;
+ EventHandler<MouseEventArgs> eventHandler1 = (sender, e1) =>
+ {
+ Action action = () =>
+ {
+ btnUnprotectedBg.IsSelected = btnUnprotectedSelectionIcon.IsSelected = btnUnprotectedSelectionTip.IsSelected = true;
+ btnStartupBg.IsSelected = btnStartupSelectionIcon.IsSelected = btnStartupSelectionTip.IsSelected = false;
+ btnSecurityBg.IsSelected = btnSecuritySelectionIcon.IsSelected = btnSecuritySelectionTip.IsSelected = false;
+ btnDoorlockBg.IsSelected = btnDoorlockSelectionIcon.IsSelected = btnDoorlockSelectionTip.IsSelected = false;
- btnTipMsg.TextID = StringId.UnprotectedTipMsg;
- btnTipMsg.Visible = true;
+ btnTipMsg.TextID = StringId.UnprotectedTipMsg;
- MainPage.LoginUser.appUnlock = new System.Collections.Generic.List<string>();
- MainPage.LoginUser.SaveUserInfo();
+ OnAppConfig.Instance.appUnlockPage = new System.Collections.Generic.List<string>();
+ OnAppConfig.Instance.appUnlockType = new System.Collections.Generic.List<string>();
+ OnAppConfig.Instance.appUnlockPasswrod = "";
+ OnAppConfig.Instance.SaveUserConfig();
+ unlockOptionView.Visible = false;
+ refreshAction();
+ };
+ Action action1 = () => {
+ if (!btnUnprotectedBg.IsSelected)
+ {
+ //1:楠岃瘉鎸囩汗
+ if (OnAppConfig.Instance.appUnlockType.Contains("3"))
+ {
+ TouchIDUtils.Instance.showTouchIDWithDescribe(null, Language.StringByID(StringId.PleaseVerifyTheFingerprint));
+ TouchIDUtils.Instance.OnHDLTouchIDStateBackEvent = (sender1, e) =>
+ {
+ if (e == TouchIDUtils.TouchIDState.NotSupport)
+ {
+ MainPage.Log("KK:褰撳墠璁惧涓嶆敮鎸乀ouchID楠岃瘉,璇疯緭鍏ュ瘑鐮佹潵楠岃瘉");
+ }
+ else if (e == TouchIDUtils.TouchIDState.Success)
+ {
+ MainPage.Log("KK:TouchID楠岃瘉鎴愬姛");
+ action();
+ }
+ else if (e == TouchIDUtils.TouchIDState.InputPassword || e == TouchIDUtils.TouchIDState.TouchIDLockout)
+ {
+ MainPage.Log("KK:鐢ㄦ埛閫夋嫨鎵嬪姩杈撳叆瀵嗙爜");
+ if (OnAppConfig.Instance.appUnlockType.Contains("1"))
+ {
+ var page = new AppUnlockPasswordPage(OnAppConfig.Instance.appUnlockPasswrod, action);
+ MainPage.BasePageView.AddChidren(page);
+ page.LoadPage("4");
+ MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1;
+ }
+ else if (OnAppConfig.Instance.appUnlockType.Contains("1"))
+ {
+ var page = new AppUnlockGesturePage(OnAppConfig.Instance.appUnlockPasswrod, action);
+ MainPage.BasePageView.AddChidren(page);
+ page.LoadPage("4");
+ MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1;
+ }
+ }
+ };
+ }
+ else if (OnAppConfig.Instance.appUnlockType.Contains("4"))
+ {
+ //Face ID楠岃瘉
+ //
+ }
+ else if (OnAppConfig.Instance.appUnlockType.Contains("1"))
+ {
+ var page = new AppUnlockPasswordPage(OnAppConfig.Instance.appUnlockPasswrod, action);
+ MainPage.BasePageView.AddChidren(page);
+ page.LoadPage("4");
+ MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1;
+ }
+ else if (OnAppConfig.Instance.appUnlockType.Contains("2"))
+ {
+ var page = new AppUnlockGesturePage(OnAppConfig.Instance.appUnlockPasswrod, action);
+ MainPage.BasePageView.AddChidren(page);
+ page.LoadPage("4");
+ MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1;
+ }
+ }
+ };
+ if (OnAppConfig.Instance.appUnlockPasswrod != "")
+ {
+ new PublicAssmebly().TipMsg(StringId.Tip, StringId.TipTurnOffUnlockingSetting, action1);
+ }
+ else
+ {
+ action();
+ }
};
btnUnprotectedBg.MouseUpEventHandler = eventHandler1;
btnUnprotectedSelectionIcon.MouseUpEventHandler = eventHandler1;
btnUnprotectedSelectionTip.MouseUpEventHandler = eventHandler1;
-
- EventHandler<MouseEventArgs> eventHandler2 = (sender, e) => {
- btnUnprotectedBg.IsSelected = btnUnprotectedSelectionIcon.IsSelected = btnUnprotectedSelectionTip.IsSelected = false;
- btnStartupBg.IsSelected = btnStartupSelectionIcon.IsSelected = btnStartupSelectionTip.IsSelected = true;
+ EventHandler<MouseEventArgs> eventHandler2 = (sender, e) =>
+ {
+ bool result = !btnStartupBg.IsSelected;
+ btnStartupBg.IsSelected = btnStartupSelectionIcon.IsSelected = btnStartupSelectionTip.IsSelected = result;
btnTipMsg.Text = Language.StringByID(StringId.AtStartupTipMsg);
- btnTipMsg.Visible = true;
-
- if (!MainPage.LoginUser.appUnlock.Contains("1"))
+ if (result)
{
- MainPage.LoginUser.appUnlock.Add("1");
- MainPage.LoginUser.SaveUserInfo();
+ btnUnprotectedBg.IsSelected = btnUnprotectedSelectionIcon.IsSelected = btnUnprotectedSelectionTip.IsSelected = false;
+ if (!OnAppConfig.Instance.appUnlockPage.Contains("1"))
+ {
+ OnAppConfig.Instance.appUnlockPage.Add("1");
+ if (OnAppConfig.Instance.appUnlockPasswrod != "")
+ OnAppConfig.Instance.SaveUserConfig();
+ }
+ unlockOptionView.Visible = true;
}
-
+ else
+ {
+ if (OnAppConfig.Instance.appUnlockPage.Contains("1"))
+ {
+ OnAppConfig.Instance.appUnlockPage.Remove("1");
+ }
+ if (OnAppConfig.Instance.appUnlockPage.Count == 0)
+ {
+ btnUnprotectedBg.IsSelected = btnUnprotectedSelectionIcon.IsSelected = btnUnprotectedSelectionTip.IsSelected = true;
+ btnTipMsg.TextID = StringId.UnprotectedTipMsg;
+ OnAppConfig.Instance.appUnlockPasswrod = "";
+ unlockOptionView.Visible = false;
+ refreshAction();
+ }
+ OnAppConfig.Instance.SaveUserConfig();
+ }
};
btnStartupBg.MouseUpEventHandler = eventHandler2;
btnStartupSelectionIcon.MouseUpEventHandler = eventHandler2;
btnStartupSelectionTip.MouseUpEventHandler = eventHandler2;
-
- EventHandler<MouseEventArgs> eventHandler3 = (sender, e) => {
- btnUnprotectedBg.IsSelected = btnUnprotectedSelectionIcon.IsSelected = btnUnprotectedSelectionTip.IsSelected = false;
- btnSecurityBg.IsSelected = btnSecuritySelectionIcon.IsSelected = btnSecuritySelectionTip.IsSelected = true;
+ EventHandler<MouseEventArgs> eventHandler3 = (sender, e) =>
+ {
+ bool result = !btnSecurityBg.IsSelected;
+ btnSecurityBg.IsSelected = btnSecuritySelectionIcon.IsSelected = btnSecuritySelectionTip.IsSelected = result;
btnTipMsg.Text = Language.StringByID(StringId.DefenseAndUndefenseTipMsg);
- btnTipMsg.Visible = true;
- if (!MainPage.LoginUser.appUnlock.Contains("2"))
+ if (result)
{
- MainPage.LoginUser.appUnlock.Add("2");
- MainPage.LoginUser.SaveUserInfo();
+ btnUnprotectedBg.IsSelected = btnUnprotectedSelectionIcon.IsSelected = btnUnprotectedSelectionTip.IsSelected = false;
+ if (!OnAppConfig.Instance.appUnlockPage.Contains("2"))
+ {
+ OnAppConfig.Instance.appUnlockPage.Add("2");
+ if (OnAppConfig.Instance.appUnlockPasswrod != "")
+ OnAppConfig.Instance.SaveUserConfig();
+ }
+ unlockOptionView.Visible = true;
}
-
+ else
+ {
+ if (OnAppConfig.Instance.appUnlockPage.Contains("2"))
+ {
+ OnAppConfig.Instance.appUnlockPage.Remove("2");
+ }
+ if (OnAppConfig.Instance.appUnlockPage.Count == 0)
+ {
+ btnUnprotectedBg.IsSelected = btnUnprotectedSelectionIcon.IsSelected = btnUnprotectedSelectionTip.IsSelected = result;
+ btnTipMsg.TextID = StringId.UnprotectedTipMsg;
+ OnAppConfig.Instance.appUnlockPasswrod = "";
+ unlockOptionView.Visible = false;
+ refreshAction();
+ }
+ OnAppConfig.Instance.SaveUserConfig();
+ }
};
btnSecurityBg.MouseUpEventHandler = eventHandler3;
btnSecuritySelectionIcon.MouseUpEventHandler = eventHandler3;
btnSecuritySelectionTip.MouseUpEventHandler = eventHandler3;
-
- EventHandler<MouseEventArgs> eventHandler4 = (sender, e) => {
- btnUnprotectedBg.IsSelected = btnUnprotectedSelectionIcon.IsSelected = btnUnprotectedSelectionTip.IsSelected = false;
- btnDoorlockBg.IsSelected = btnDoorlockSelectionIcon.IsSelected = btnDoorlockSelectionTip.IsSelected = true;
+ EventHandler<MouseEventArgs> eventHandler4 = (sender, e) =>
+ {
+ bool result = !btnDoorlockBg.IsSelected;
+ btnDoorlockBg.IsSelected = btnDoorlockSelectionIcon.IsSelected = btnDoorlockSelectionTip.IsSelected = result;
btnTipMsg.Text = Language.StringByID(StringId.RemoteUnlockingTipMsg);
- btnTipMsg.Visible = true;
-
- if (!MainPage.LoginUser.appUnlock.Contains("3"))
+ if (result)
{
- MainPage.LoginUser.appUnlock.Add("3");
- MainPage.LoginUser.SaveUserInfo();
+ btnUnprotectedBg.IsSelected = btnUnprotectedSelectionIcon.IsSelected = btnUnprotectedSelectionTip.IsSelected = false;
+ if (!OnAppConfig.Instance.appUnlockPage.Contains("3"))
+ {
+ OnAppConfig.Instance.appUnlockPage.Add("3");
+ if (OnAppConfig.Instance.appUnlockPasswrod != "")
+ OnAppConfig.Instance.SaveUserConfig();
+ }
+ unlockOptionView.Visible = true;
}
-
+ else
+ {
+ if (OnAppConfig.Instance.appUnlockPage.Contains("3"))
+ {
+ OnAppConfig.Instance.appUnlockPage.Remove("3");
+ }
+ if (OnAppConfig.Instance.appUnlockPage.Count == 0)
+ {
+ btnUnprotectedBg.IsSelected = btnUnprotectedSelectionIcon.IsSelected = btnUnprotectedSelectionTip.IsSelected = true;
+ btnTipMsg.TextID = StringId.UnprotectedTipMsg;
+ OnAppConfig.Instance.appUnlockPasswrod = "";
+ unlockOptionView.Visible = false;
+ refreshAction();
+ }
+ OnAppConfig.Instance.SaveUserConfig();
+ }
};
btnDoorlockBg.MouseUpEventHandler = eventHandler4;
btnDoorlockSelectionIcon.MouseUpEventHandler = eventHandler4;
btnDoorlockSelectionTip.MouseUpEventHandler = eventHandler4;
-
-
-
}
/// <summary>
@@ -99,23 +238,26 @@
/// </summary>
void LoadEvent_InitOptionState()
{
- if (MainPage.LoginUser.appUnlock.Count == 0)
+ if (OnAppConfig.Instance.appUnlockPage.Count == 0)
{
btnUnprotectedBg.IsSelected = btnUnprotectedSelectionIcon.IsSelected = btnUnprotectedSelectionTip.IsSelected = true;
}
else
{
- if (MainPage.LoginUser.appUnlock.Contains("1"))
+ if (OnAppConfig.Instance.appUnlockPage.Contains("1"))
{
btnStartupBg.IsSelected = btnStartupSelectionIcon.IsSelected = btnStartupSelectionTip.IsSelected = true;
+ btnTipMsg.Text = Language.StringByID(StringId.AtStartupTipMsg);
}
- if (MainPage.LoginUser.appUnlock.Contains("2"))
+ if (OnAppConfig.Instance.appUnlockPage.Contains("2"))
{
btnSecurityBg.IsSelected = btnSecuritySelectionIcon.IsSelected = btnSecuritySelectionTip.IsSelected = true;
+ btnTipMsg.Text = Language.StringByID(StringId.DefenseAndUndefenseTipMsg);
}
- if (MainPage.LoginUser.appUnlock.Contains("3"))
+ if (OnAppConfig.Instance.appUnlockPage.Contains("3"))
{
btnDoorlockBg.IsSelected = btnDoorlockSelectionIcon.IsSelected = btnDoorlockSelectionTip.IsSelected = true;
+ btnTipMsg.Text = Language.StringByID(StringId.RemoteUnlockingTipMsg);
}
}
}
@@ -127,11 +269,99 @@
{
btnPasswordUnlockTitle.MouseUpEventHandler = (sender, e) =>
{
- var page = new AppUnlockPasswordSettingPage(MainPage.LoginUser.appUnlockPasswrod);
+ var page = new AppUnlockPasswordPage(OnAppConfig.Instance.appUnlockPasswrod, refreshAction);
MainPage.BasePageView.AddChidren(page);
- page.LoadPage();
+ page.LoadPage(OnAppConfig.Instance.appUnlockType.Contains("1") ? "3" : "1");
MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1;
};
+
+ btnResetPasswordTitle.MouseUpEventHandler = (sender, e) =>
+ {
+ var page = new AppUnlockPasswordPage(OnAppConfig.Instance.appUnlockPasswrod, refreshAction);
+ MainPage.BasePageView.AddChidren(page);
+ page.LoadPage("2");
+ MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1;
+ };
+
+ btnGestureUnlockTitle.MouseUpEventHandler = (sender, e) =>
+ {
+ var page = new AppUnlockGesturePage(OnAppConfig.Instance.appUnlockPasswrod, refreshAction);
+ MainPage.BasePageView.AddChidren(page);
+ page.LoadPage(OnAppConfig.Instance.appUnlockType.Contains("2") ? "3" : "1");
+ MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1;
+ };
+ btnResetGestureTitle.MouseUpEventHandler = (sender, e) =>
+ {
+ var page = new AppUnlockGesturePage(OnAppConfig.Instance.appUnlockPasswrod, refreshAction);
+ MainPage.BasePageView.AddChidren(page);
+ page.LoadPage("3");
+ MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1;
+ };
+
+ if (sTouchID)
+ {
+ btnFingerprintUnlockSwtichIcon.MouseUpEventHandler = (sender, e1) =>
+ {
+ Action fingerAction = () => {
+ TouchIDUtils.Instance.showTouchIDWithDescribe(null, Language.StringByID(StringId.PleaseVerifyTheFingerprint));
+ };
+ new AppUnlockPage().LoadGesturePage("5",fingerAction);
+
+ TouchIDUtils.Instance.showTouchIDWithDescribe(null, Language.StringByID(StringId.PleaseVerifyTheFingerprint));
+
+ TouchIDUtils.Instance.OnHDLTouchIDStateBackEvent = (sender1, e) =>
+ {
+ if (e == TouchIDUtils.TouchIDState.Success)
+ {
+ var result = btnFingerprintUnlockSwtichIcon.IsSelected = !btnFingerprintUnlockSwtichIcon.IsSelected;
+ if (result)
+ {
+ if (!OnAppConfig.Instance.appUnlockType.Contains("3"))
+ {
+ OnAppConfig.Instance.appUnlockType.Add("3");
+ OnAppConfig.Instance.SaveUserConfig();
+ }
+ }
+ else
+ {
+ if (OnAppConfig.Instance.appUnlockType.Contains("3"))
+ {
+ OnAppConfig.Instance.appUnlockType.Remove("3");
+ OnAppConfig.Instance.SaveUserConfig();
+ }
+ }
+ //MainPage.BasePageView.RemoveAt(MainPage.BasePageView.ChildrenCount - 1);
+ MainPage.BasePageView.GetChildren(MainPage.BasePageView.ChildrenCount - 1).RemoveFromParent();
+ }
+ else// if (e == TouchIDUtils.TouchIDState.InputPassword || e == TouchIDUtils.TouchIDState.TouchIDLockout)
+ {
+ if (OnAppConfig.Instance.appUnlockType.Contains("1"))
+ {
+ var page = new AppUnlockPasswordPage(OnAppConfig.Instance.appUnlockPasswrod, refreshAction);
+ MainPage.BasePageView.AddChidren(page);
+ page.LoadPage("5");
+ MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1;
+ }
+ else if (OnAppConfig.Instance.appUnlockType.Contains("2"))
+ {
+ var page = new AppUnlockGesturePage(OnAppConfig.Instance.appUnlockPasswrod, refreshAction);
+ MainPage.BasePageView.AddChidren(page);
+ page.LoadPage("5");
+ MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1;
+ }
+ }
+ };
+ };
+ }
+ if (sFaceID)
+ {
+ btnFaceIdUnlockSwtichIcon.MouseUpEventHandler = (sender, e1) =>
+ {
+ //btnFaceIdUnlockSwtichIcon.IsSelected = !btnFaceIdUnlockSwtichIcon.IsSelected;
+ if (!btnFaceIdUnlockSwtichIcon.IsSelected)
+ { }
+ };
+ }
}
}
-}
+}
\ No newline at end of file
--
Gitblit v1.8.0