| | |
| | | // Utlis.WriteLine (ex.ToString ()); |
| | | //} |
| | | |
| | | ShowBodyView (); |
| | | |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 当前setting页面 加载是否分享住宅角色,决定是否隐藏相应的菜单按钮 |
| | | /// </summary> |
| | | static bool IsOthreShare = false; |
| | | /// <summary> |
| | | /// 住宅列表页面 |
| | | /// 切换住宅后需要判断是否需要隐藏或者显示功能菜单按钮刷新布局 |
| | | /// 当前住宅自己的:显示数据接收、同步数据、定时器、alexa、子账号管理 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), |
| | |
| | | |
| | | #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--- |
| | |
| | | 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; |
| | |
| | | }; |
| | | 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); |
| | |
| | | BackgroundColor = SkinStyle.Current.MainColor |
| | | }; |
| | | UserMiddle.SettingView.AddChidren (btnNullSkin); |
| | | |
| | | } |
| | | |
| | | static void GoData () |
| | |
| | | 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 (); |
| | | }); |
| | | } |
| | | |
| | | |
| | | } |
| | | |
| | | } |