From 0fafbe4b132d03dc8f1f99de585bfcb5e63ab60a Mon Sep 17 00:00:00 2001
From: wxr <464027401@qq.com>
Date: 星期一, 09 一月 2023 14:02:01 +0800
Subject: [PATCH] 多网关支持
---
Crabtree/SmartHome/UI/SimpleControl/Phone/User/UserSettingView.cs | 133 ++++++++++++++++++++++++-------------------
1 files changed, 74 insertions(+), 59 deletions(-)
diff --git a/Crabtree/SmartHome/UI/SimpleControl/Phone/User/UserSettingView.cs b/Crabtree/SmartHome/UI/SimpleControl/Phone/User/UserSettingView.cs
index f7b1522..6046a51 100644
--- a/Crabtree/SmartHome/UI/SimpleControl/Phone/User/UserSettingView.cs
+++ b/Crabtree/SmartHome/UI/SimpleControl/Phone/User/UserSettingView.cs
@@ -48,6 +48,39 @@
// Utlis.WriteLine (ex.ToString ());
//}
+ ShowBodyView ();
+
+ }
+
+ /// <summary>
+ /// 褰撳墠setting椤甸潰 鍔犺浇鏄惁鍒嗕韩浣忓畢瑙掕壊,鍐冲畾鏄惁闅愯棌鐩稿簲鐨勮彍鍗曟寜閽�
+ /// </summary>
+ static bool IsOthreShare = false;
+ /// <summary>
+ /// 浣忓畢鍒楄〃椤甸潰
+ /// 鍒囨崲浣忓畢鍚庨渶瑕佸垽鏂槸鍚﹂渶瑕侀殣钘忔垨鑰呮樉绀哄姛鑳借彍鍗曟寜閽埛鏂板竷灞�
+ /// 褰撳墠浣忓畢鑷繁鐨勶細鏄剧ず鏁版嵁鎺ユ敹銆佸悓姝ユ暟鎹�佸畾鏃跺櫒銆乤lexa銆佸瓙璐﹀彿绠$悊 5涓姛鑳借彍鍗曟寜閽�
+ /// 瀛愯处鍙峰綋鍓嶄綇瀹呬笉鏄嚜宸辩殑锛氶殣钘忎笂闈�5涓寜閽�
+ /// </summary>
+ public static void CheckIfRefreshView ()
+ {
+ if(UserConfig.Instance.CurrentRegion.IsOthreShare != IsOthreShare) {
+ ShowBodyView ();
+ //Utlis.WriteLine ("闇�瑕佸埛鏂�");
+ }
+ }
+
+ /// <summary>
+ /// 鍔犺浇BodyView
+ /// </summary>
+ public static void ShowBodyView ()
+ {
+ if (UserMiddle.SettingView == null) return;
+
+ UserMiddle.SettingView.RemoveAll ();
+
+ IsOthreShare = UserConfig.Instance.CurrentRegion.IsOthreShare;
+
FrameLayout topUserMsgView = new FrameLayout () {
Y = Application.GetRealHeight (126),
Height = Application.GetRealHeight (175),
@@ -211,39 +244,39 @@
#region ---鏁版嵁鎺ユ敹---
//if (MainPage.LoginUser.AccountType == 2 || MainPage.LoginUser.AccountString == @"464027401@qq.com") {
- 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---
@@ -321,7 +354,13 @@
return;
}
- HDLLinkUtlis.Current.OneclickUpload ();
+ //ok浜嬩欢
+ Action okAction = () => {
+ HDLLinkUtlis.Current.OneclickUpload ();
+ };
+
+ CommonUtlis.Current.ShowActionAlert (Language.StringByID (R.MyInternationalizationString.DoYouWantToSynchronizeToTheCloud), okAction);
+
};
SyncDeviceView.MouseUpEventHandler += SyncDeviceEventHandler;
btnSyncDeviceIcon.MouseUpEventHandler += SyncDeviceEventHandler;
@@ -386,10 +425,11 @@
};
AlexaView.AddChidren (btnAlexaIcon);
+ //鏅鸿兘闊崇
Button btnAlexaTitle = new Button () {
X = Application.GetRealWidth (125),
TextAlignment = TextAlignment.CenterLeft,
- Text = "Alexa Integration",
+ Text = "Smart speaker",
TextColor = SkinStyle.Current.TextColor1,
};
AlexaView.AddChidren (btnAlexaTitle);
@@ -551,7 +591,6 @@
BackgroundColor = SkinStyle.Current.MainColor
};
UserMiddle.SettingView.AddChidren (btnNullSkin);
-
}
static void GoData ()
@@ -637,30 +676,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