Crabtree/.vs/SmartHome/xs/UserPrefs.xml
@@ -1,17 +1,43 @@ <Properties StartupConfiguration="{1D83BF28-BA88-4152-BA41-D7EFE90A5437}|Default"> <MonoDevelop.Ide.ItemProperties.ON.Droid PreferredExecutionTarget="Android.Android_Accelerated_Oreo" /> <MonoDevelop.Ide.Workbench> <MonoDevelop.Ide.Workbench ActiveDocument="ON.Ios/Resources/Language.ini"> <Files> <File FileName="SmartHome/UI/SimpleControl/Phone/Schedule/AddSchedule.cs" Line="1167" Column="53" /> <File FileName="SmartHome/UI/SimpleControl/Phone/Scene/SceneMethod.cs" Line="62" Column="43" /> <File FileName="SmartHome/UI/SimpleControl/Phone/Scene/UserAddSceneDevice.cs" Line="1850" Column="23" /> <File FileName="SmartHome/HDL/Operation/Device/FanModule.cs" Line="6" Column="15" /> <File FileName="SmartHome/UI/SimpleControl/Phone/Alexa/SmartSpeakertListPage.cs" Line="153" Column="48" /> <File FileName="SmartHome/HDL/Common/HttpUtil/HttpUtil.cs" Line="236" Column="1" /> <File FileName="SmartHome/HDL/Common/CommonUtlis.cs" Line="264" Column="27" /> <File FileName="ON/Assets/Language.ini" Line="1114" Column="1" /> <File FileName="SmartHome/UI/SimpleControl/R.cs" Line="1222" Column="44" /> <File FileName="ON.Ios/Resources/Language.ini" Line="2230" Column="1" /> </Files> <Pads> <Pad Id="ProjectPad"> <State name="__root__"> <Node name="SmartHome" expanded="True"> <Node name="ON.Droid" selected="True" /> <Node name="ON.Droid" expanded="True"> <Node name="Assets" expanded="True" /> </Node> <Node name="ON.Ios" expanded="True"> <Node name="References" expanded="True" /> <Node name="Resources" expanded="True"> <Node name="Language.ini" selected="True" /> </Node> </Node> <Node name="Shared" expanded="True"> <Node name="HDL" expanded="True"> <Node name="Common" expanded="True"> <Node name="HttpUtil" expanded="True" /> </Node> </Node> <Node name="UI" expanded="True"> <Node name="SimpleControl" expanded="True"> <Node name="Phone" expanded="True"> <Node name="Alexa" expanded="True" /> <Node name="Schedule" expanded="True" /> <Node name="User" expanded="True" /> </Node> </Node> </Node> </Node> </Node> </State> </Pad> @@ -25,7 +51,7 @@ <String>IosService/IosService.csproj</String> <String>DroidService/DroidService.csproj</String> </DisabledProjects> <MonoDevelop.Ide.Workspace ActiveConfiguration="Release|iPhone" /> <MonoDevelop.Ide.Workspace ActiveConfiguration="Debug|iPhone" /> <MonoDevelop.Ide.ItemProperties.ON.Ios automaticSigning="False" PreferredExecutionTarget="MonoDevelop.IPhone.IPhoneDeviceTarget.00008030-00014C392121802E" /> <MonoDevelop.Ide.DebuggingService.Breakpoints> <BreakpointStore> Crabtree/ON.Ios/ON.Ios.csproj
@@ -47,7 +47,6 @@ <MtouchExtraArgs>-gcc_flags="-dead_strip -ObjC"</MtouchExtraArgs> <CheckForOverflowUnderflow>true</CheckForOverflowUnderflow> <DeviceSpecificBuild>true</DeviceSpecificBuild> <CodesignProvision>iOS Team Provisioning Profile: *</CodesignProvision> <NoStdLib>false</NoStdLib> <MtouchUseThumb></MtouchUseThumb> </PropertyGroup> Crabtree/ON.Ios/Resources/Language.ini
@@ -1111,6 +1111,9 @@ 20060=Failed to sync the device and scene data to the cloud! 20061=Do you want to synchronize all local devices and scenes to the cloud? This will be used for schedule and alexa control functions. 20062=Resend 20063=Are you sure to unbind? 20064=Unbind successfully 20065=Please enter content! [Chinese] 1=你好 @@ -2224,6 +2227,9 @@ 20060=Failed to sync the device and scene data to the cloud! 20061=Do you want to synchronize all local devices and scenes to the cloud? This will be used for schedule and alexa control functions. 20062=Resend 20063=Are you sure to unbind? 20064=Unbind successfully 20065=Please enter content! [Czech] 1=Nazdar Crabtree/ON/Assets/Language.ini
@@ -1111,6 +1111,9 @@ 20060=Failed to sync the device and scene data to the cloud! 20061=Do you want to synchronize all local devices and scenes to the cloud? This will be used for schedule and alexa control functions. 20062=Resend 20063=Are you sure to unbind? 20064=Unbind successfully 20065=Please enter content! [Chinese] 1=你好 @@ -2224,6 +2227,9 @@ 20060=Failed to sync the device and scene data to the cloud! 20061=Do you want to synchronize all local devices and scenes to the cloud? This will be used for schedule and alexa control functions. 20062=Resend 20063=Are you sure to unbind? 20064=Unbind successfully 20065=Please enter content! [Czech] Crabtree/ON/Properties/AndroidManifest.xml
@@ -1,5 +1,5 @@ <?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.hdl.crabtreenew" android:versionName="2.603291" android:versionCode="202103291"> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.hdl.crabtreenew" android:versionName="2.604151" android:versionCode="202104151"> <uses-sdk android:minSdkVersion="23" android:targetSdkVersion="28" /> <!-- 在安卓P版本之后,必须要授予FOREGROUND_SERVICE权限,才能够使用前台服务 --> <uses-permission android:name="android.permission.FOREGROUND_SERVICE" /> Crabtree/SmartHome/HDL/Common/CommonUtlis.cs
@@ -261,6 +261,12 @@ btnOption.MouseUpEventHandler += (sdf, fds) => { //修改名称 var newStr = etZoneName.Text.Trim (); //输入内容不能为空 if (string.IsNullOrEmpty (newStr)) { Utlis.ShowTip (Language.StringByID(SimpleControl.R.MyInternationalizationString.PleaseEnterContent)); return; } if (nameStr != newStr) { saveAction?.Invoke (newStr); } Crabtree/SmartHome/HDL/Common/HttpUtil/HttpServerRequest.cs
@@ -915,6 +915,17 @@ } /// <summary> /// 解除音箱绑定 /// </summary> /// <returns></returns> public ResponsePackNew UnbindSpeaker (string tokenId) { Dictionary<string, object> d = new Dictionary<string, object> (); d.Add ("tokenId", tokenId); var requestJson = HttpUtil.GetSignRequestJson (d); return HttpUtil.RequestHttpsPostFroHome (NewAPI.API_POST_Speaker_Unbind, requestJson); } /// <summary> /// 获取音箱分配的设备和场景列表 /// </summary> /// <param name="getType">0 是查询全部 1是查询设备 2是查询场景</param> Crabtree/SmartHome/HDL/Common/HttpUtil/NewAPI.cs
@@ -491,6 +491,10 @@ /// </summary> public const string API_POST_Speaker_Remark_Update = "/smart-footstone/app/token/update"; /// <summary> /// 解绑音箱 /// </summary> public const string API_POST_Speaker_Unbind = "/smart-footstone/app/token/delete"; /// <summary> /// 获取音箱分配的设备和场景列表 /// </summary> public const string API_POST_Speaker_DeviceList_Get = "/home-wisdom/app/tokenRelation/list"; Crabtree/SmartHome/UI/SimpleControl/MainPage.cs
@@ -38,7 +38,7 @@ //public static Button LogoButton = new Button (); public static string RequestVersion = "2.603291"; public static string RequestVersion = "2.604151"; public static UserInfo LoginUser; /// <summary> /// 是否是管理员权限(变更了,成员的时候,这个也为ture。为什么会声明这样变量,因为有些接口必须使用原来的Token) Crabtree/SmartHome/UI/SimpleControl/Phone/Alexa/AlexaDeviceListPage.cs
@@ -50,7 +50,16 @@ { #region ---TopView--- base.ShowPage (); this.topTitleBtn.Text = "Alexa"; //this.topTitleBtn.Text = "Alexa"; //设置标题为音箱备注 if (mAlexa != null) { if (string.IsNullOrEmpty (mAlexa.remark)) { this.topTitleBtn.Text = mAlexa.platformName; } else { this.topTitleBtn.Text = mAlexa.remark; } } //添加按钮点击事件 EventHandler<MouseEventArgs> addSubaccountHandler = (sender, e) => { OpenAlexaSettingPage (); @@ -60,7 +69,7 @@ #region 设备-场景 var topView = new FrameLayout () { Height = Application.GetRealHeight (110), Height = Application.GetRealWidth (110), BackgroundColor = SkinStyle.Current.TitileView, }; BaseContentView.AddChidren (topView); Crabtree/SmartHome/UI/SimpleControl/Phone/Alexa/SmartSpeakertListPage.cs
@@ -21,7 +21,7 @@ { #region ---TopView--- base.ShowPage (); this.topTitleBtn.Text = "Alexa list"; this.topTitleBtn.Text = "Smart speaker"; this.topItemButton.RemoveFromParent (); #endregion @@ -140,19 +140,37 @@ #region 重命名 var btnRename = new Button () { TextID = R.MyInternationalizationString.rename, BackgroundColor = SkinStyle.Current.DelColor, BackgroundColor = SkinStyle.Current.TitileView, TextSize = 11, }; //保存事件 Action<string> renameAction = (newName) => { RenameAlexaRemark (newName, speakerInfo, btnName); RenameAlexaRemark (newName, speakerInfo, btnName, rowView); }; btnRename.MouseUpEventHandler += (sender, e) => { CommonUtlis.Current.ShowEditTextDialog (speakerInfo.remark, renameAction, Language.StringByID (R.MyInternationalizationString.rename)); }; rowView.AddRightView (btnRename); #endregion #region 删除 var btnDelete = new Button () { TextID = R.MyInternationalizationString.Delete, BackgroundColor = SkinStyle.Current.DelColor, TextSize = 11, }; //删除事件 Action deleteAction = () => { UnbindSpeaker (speakerInfo, rowView); }; btnDelete.MouseUpEventHandler += (sender, e) => { CommonUtlis.Current.ShowActionAlert (Language.StringByID (R.MyInternationalizationString.DoYouWantToUnbind), deleteAction); }; rowView.AddRightView (btnDelete); #endregion } @@ -163,7 +181,7 @@ /// <param name="newName"></param> /// <param name="speakerInfo"></param> /// <param name="btnName"></param> void RenameAlexaRemark (string newName, SpeakerInfo speakerInfo, Button btnName) void RenameAlexaRemark (string newName, SpeakerInfo speakerInfo, Button btnName, RowLayout rowView) { MainPage.Loading.Start (Language.StringByID (R.MyInternationalizationString.load)); @@ -181,6 +199,7 @@ Application.RunOnMainThread (() => { speakerInfo.remark = newName; btnName.Text = newName; rowView.HideRightMenu (); Utlis.ShowAlertOnMainThread (Language.StringByID (R.MyInternationalizationString.AmendTheSuccess)); }); @@ -220,5 +239,49 @@ UserMiddle.SettingPageView.PageIndex = UserMiddle.SettingPageView.ChildrenCount - 1; } /// <summary> /// 请求解绑音箱 /// </summary> /// <param name="speakerInfo">音箱参数</param> /// <param name="rowView">音箱rowView</param> void UnbindSpeaker (SpeakerInfo speakerInfo, RowLayout rowView) { if (speakerInfo == null || string.IsNullOrEmpty (speakerInfo.tokenId)) { Utlis.ShowTip (Language.StringByID (R.MyInternationalizationString.RequestFailedParameterException) + "(-3)"); } MainPage.Loading.Start (Language.StringByID (R.MyInternationalizationString.load)); System.Threading.Tasks.Task.Run (() => { try { var revertObj = HttpServerRequest.Current.UnbindSpeaker (speakerInfo.tokenId); if (revertObj.Code == StateCode.SUCCESS) { //解绑成功 Application.RunOnMainThread (() => { //rowView if (rowView != null) { rowView.RemoveFromParent (); } //提示解绑成功 Utlis.ShowTip (Language.StringByID (R.MyInternationalizationString.UnbindSuccessfully)); }); } else { //提示错误 IMessageCommon.Current.ShowErrorInfoAlter (revertObj.Code); } } catch { } finally { Application.RunOnMainThread (() => { MainPage.Loading.Hide (); }); } }); } } } Crabtree/SmartHome/UI/SimpleControl/Phone/User/UserSettingView.cs
@@ -360,6 +360,7 @@ }; CommonUtlis.Current.ShowActionAlert (Language.StringByID (R.MyInternationalizationString.DoYouWantToSynchronizeToTheCloud), okAction); }; SyncDeviceView.MouseUpEventHandler += SyncDeviceEventHandler; btnSyncDeviceIcon.MouseUpEventHandler += SyncDeviceEventHandler; @@ -424,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); Crabtree/SmartHome/UI/SimpleControl/R.cs
@@ -1208,6 +1208,20 @@ /// Resend /// </summary> public const int Resend = 20062; /// <summary> /// DoYouWantToUnbind /// </summary> public const int DoYouWantToUnbind = 20063; /// <summary> /// Unbind successfully /// </summary> public const int UnbindSuccessfully = 20064; /// <summary> /// Please enter content /// </summary> public const int PleaseEnterContent = 20065; #endregion } }