From 1606d40b0eaf15c6db0f436495eb4953a4c8ac3e Mon Sep 17 00:00:00 2001
From: JLChen <551775569@qq.com>
Date: 星期三, 03 三月 2021 18:41:38 +0800
Subject: [PATCH] 2021-03-03 1.更新
---
Crabtree/SmartHome/UI/SimpleControl/Phone/User/UserSettingView.cs | 147 ++++++++++++++++++++++++++++--------------------
1 files changed, 86 insertions(+), 61 deletions(-)
diff --git a/Crabtree/SmartHome/UI/SimpleControl/Phone/User/UserSettingView.cs b/Crabtree/SmartHome/UI/SimpleControl/Phone/User/UserSettingView.cs
index eb4ce52..b4f8024 100644
--- a/Crabtree/SmartHome/UI/SimpleControl/Phone/User/UserSettingView.cs
+++ b/Crabtree/SmartHome/UI/SimpleControl/Phone/User/UserSettingView.cs
@@ -211,43 +211,40 @@
#region ---鏁版嵁鎺ユ敹---
//if (MainPage.LoginUser.AccountType == 2 || MainPage.LoginUser.AccountString == @"464027401@qq.com") {
- if (true) {
- var DataReceptionView = new FrameLayout () {
- Width = Application.GetRealWidth (640),
- Height = Application.GetRealHeight (100),
- BackgroundColor = SkinStyle.Current.ViewColor
- };
- UserMiddle.SettingView.AddChidren (DataReceptionView);
- var btnDataReceptionIcon = new Button () {
- X = Application.GetRealWidth (30),
- Gravity = Gravity.CenterVertical,
- Width = Application.GetRealWidth (75),
- Height = Application.GetRealHeight (75),
- UnSelectedImagePath = "AccountSettings/DataShared.png"
- };
- DataReceptionView.AddChidren (btnDataReceptionIcon);
- var btnDataReceptionTitle = new Button () {
- X = Application.GetRealWidth (125),
- TextAlignment = TextAlignment.CenterLeft,
- TextID = R.MyInternationalizationString.DataReception,
- TextColor = SkinStyle.Current.TextColor1,
- };
- DataReceptionView.AddChidren (btnDataReceptionTitle);
- EventHandler<MouseEventArgs> DataReceptionEventHandler = (sender, e) => {
+ var DataReceptionView = new FrameLayout () {
+ Width = Application.GetRealWidth (640),
+ Height = Application.GetRealHeight (100),
+ BackgroundColor = SkinStyle.Current.ViewColor
+ };
+ //UserMiddle.SettingView.AddChidren (DataReceptionView);
+ var btnDataReceptionIcon = new Button () {
+ X = Application.GetRealWidth (30),
+ Gravity = Gravity.CenterVertical,
+ Width = Application.GetRealWidth (75),
+ Height = Application.GetRealHeight (75),
+ UnSelectedImagePath = "AccountSettings/DataShared.png"
+ };
+ DataReceptionView.AddChidren (btnDataReceptionIcon);
+ var btnDataReceptionTitle = new Button () {
+ X = Application.GetRealWidth (125),
+ TextAlignment = TextAlignment.CenterLeft,
+ TextID = R.MyInternationalizationString.DataReception,
+ TextColor = SkinStyle.Current.TextColor1,
+ };
+ DataReceptionView.AddChidren (btnDataReceptionTitle);
+ EventHandler<MouseEventArgs> DataReceptionEventHandler = (sender, e) => {
- GoData ();
- };
- DataReceptionView.MouseUpEventHandler += DataReceptionEventHandler;
- btnDataReceptionIcon.MouseUpEventHandler += DataReceptionEventHandler;
- btnDataReceptionTitle.MouseUpEventHandler += DataReceptionEventHandler;
- Button btnNull3 = new Button () {
- BackgroundColor = SkinStyle.Current.MainColor,
- Height = Application.GetRealHeight (5)
- };
- UserMiddle.SettingView.AddChidren (btnNull3);
- }
+ GoData ();
+ };
+ DataReceptionView.MouseUpEventHandler += DataReceptionEventHandler;
+ btnDataReceptionIcon.MouseUpEventHandler += DataReceptionEventHandler;
+ btnDataReceptionTitle.MouseUpEventHandler += DataReceptionEventHandler;
+ Button btnNull3 = new Button () {
+ BackgroundColor = SkinStyle.Current.MainColor,
+ Height = Application.GetRealHeight (5)
+ };
+ //UserMiddle.SettingView.AddChidren (btnNull3);
#endregion
-
#region ---msg---
//FrameLayout WarningMsgView = new FrameLayout () {
@@ -294,6 +291,53 @@
//UserMiddle.SettingView.AddChidren (btnNullWarningMsg);
#endregion
+ #region ---鍚屾璁惧---
+ FrameLayout SyncDeviceView = new FrameLayout () {
+ Width = Application.GetRealWidth (640),
+ Height = Application.GetRealHeight (100),
+ BackgroundColor = SkinStyle.Current.ViewColor
+ };
+ Button btnSyncDeviceIcon = new Button () {
+ X = Application.GetRealWidth (30),
+ Gravity = Gravity.CenterVertical,
+ Width = Application.GetRealWidth (75),
+ Height = Application.GetRealWidth (75),
+ UnSelectedImagePath = "CrabtreeAdd/Alexa.png",
+ };
+ SyncDeviceView.AddChidren (btnSyncDeviceIcon);
+
+ Button btnSyncDeviceTitle = new Button () {
+ X = Application.GetRealWidth (125),
+ TextAlignment = TextAlignment.CenterLeft,
+ TextID = R.MyInternationalizationString.SyncToTheCloud,
+ //Text = "涓婁紶璁惧",
+ TextColor = SkinStyle.Current.TextColor1,
+ };
+ SyncDeviceView.AddChidren (btnSyncDeviceTitle);
+ EventHandler<MouseEventArgs> SyncDeviceEventHandler = (sender, e) => {
+ //娌$粦瀹氬繕璁版彁绀哄厛缁戝畾缃戝叧锛岀姝㈣烦杞�
+ if (!UserConfig.Instance.CheckWhetherGatewayIdNotNull ()) {
+ Utlis.ShowAlertOnMainThread (Language.StringByID (R.MyInternationalizationString.PleaseBindTheGatewayFirst));
+ return;
+ }
+
+ //ok浜嬩欢
+ Action okAction = () => {
+ HDLLinkUtlis.Current.OneclickUpload ();
+ };
+
+ CommonUtlis.Current.ShowActionAlert (Language.StringByID (R.MyInternationalizationString.DoYouWantToSynchronizeToTheCloud), okAction);
+ };
+ SyncDeviceView.MouseUpEventHandler += SyncDeviceEventHandler;
+ btnSyncDeviceIcon.MouseUpEventHandler += SyncDeviceEventHandler;
+ btnSyncDeviceTitle.MouseUpEventHandler += SyncDeviceEventHandler;
+ Button btnNullSyncDevice = new Button () {
+ Height = Application.GetRealHeight (5),
+ BackgroundColor = SkinStyle.Current.MainColor
+ };
+ //UserMiddle.SettingView.AddChidren (btnNullSchedule);
+ #endregion
+
#region ---Schedule---
FrameLayout ScheduleView = new FrameLayout () {
Width = Application.GetRealWidth (640),
@@ -332,7 +376,6 @@
//UserMiddle.SettingView.AddChidren (btnNullSchedule);
#endregion
-
#region ---Alexa---
FrameLayout AlexaView = new FrameLayout () {
Width = Application.GetRealWidth (640),
@@ -344,7 +387,7 @@
Gravity = Gravity.CenterVertical,
Width = Application.GetRealWidth (75),
Height = Application.GetRealWidth (75),
- UnSelectedImagePath = "CrabtreeAdd/Alexa.png",
+ UnSelectedImagePath = "CrabtreeAdd/Speaker.png",
};
AlexaView.AddChidren (btnAlexaIcon);
@@ -445,6 +488,12 @@
if (!UserConfig.Instance.CurrentRegion.IsOthreShare) {
//涓昏处鍙峰紑鏀捐鍔熻兘;
+ UserMiddle.SettingView.AddChidren (DataReceptionView);
+ UserMiddle.SettingView.AddChidren (btnNull3);
+
+ UserMiddle.SettingView.AddChidren (SyncDeviceView);
+ UserMiddle.SettingView.AddChidren (btnNullSyncDevice);
+
UserMiddle.SettingView.AddChidren (ScheduleView);
UserMiddle.SettingView.AddChidren (btnNullSchedule);
UserMiddle.SettingView.AddChidren (AlexaView);
@@ -593,30 +642,6 @@
dialog.Close ();
};
dialog.Show ();
- }
-
-
-
- /// <summary>
- ///
- /// </summary>
- /// <param name="stateCodeStr"></param>
- static void ShowGetSubAccountByDistributedMarkErrorInfo (string stateCodeStr)
- {
- string mes = "";
-
- if (stateCodeStr == ErrorCode.NetworkError) {
- mes = ErrorCode.NetworkError;
- } else {
- mes = ErrorCode.OperationFailed + ErrorCode.Reason + stateCodeStr;
- }
- if (!string.IsNullOrEmpty (mes)) {
- Application.RunOnMainThread (() => {
- new Alert ("", mes, Language.StringByID (R.MyInternationalizationString.Close)).Show ();
- });
- }
-
-
}
}
--
Gitblit v1.8.0