| | |
| | | using ZigBee.Device; |
| | | using Shared.Phone.Device.Logic.LogicView; |
| | | |
| | | |
| | | namespace Shared.Phone.Device.Logic |
| | | { |
| | | |
| | |
| | | } |
| | | public void Show() |
| | | { |
| | | #region 上面的布局代码 |
| | | |
| | | #region 界面的布局代码 |
| | | TopView view = new TopView(); |
| | | this.AddChidren(view.TopRowView()); |
| | | view.toptitleNameBtn.TextID = MyInternationalizationString.selection; |
| | | view.clickBtn.MouseDownEventHandler += (sender, e) => { RemoveFromParent(); }; |
| | | #endregion |
| | | #region 最下面的布局代码 |
| | | view.clickBtn.MouseDownEventHandler += (sender, e) => { RemoveFromParent(); };
|
| | | |
| | | var middle = new FrameLayout |
| | | { |
| | | Y = view.topRowLayout.Bottom, |
| | | Height = Application.GetRealHeight(1920 - 184), |
| | | Height = Application.GetRealHeight(Method.H - 184), |
| | | BackgroundColor = ZigbeeColor.Current.LogicMiddleBackgroundColor, |
| | | }; |
| | | this.AddChidren(middle); |
| | |
| | | timeView.iconBtn.UnSelectedImagePath = "ZigeeLogic/time.png"; |
| | | timeView.funnameBtn.TextID = MyInternationalizationString.timecondition; |
| | | middle.AddChidren(timeView.FunFrameView()); |
| | | timeView.clickviewBtn.MouseUpEventHandler += (sender, e) => |
| | | { |
| | | TimeView(); |
| | | }; |
| | | |
| | | ///设备 |
| | | FunView functionView = new FunView(); |
| | | functionView.funFrameLayout.Y = timeView.funFrameLayout.Bottom; |
| | | functionView.iconBtn.UnSelectedImagePath = "ZigeeLogic/function.png"; |
| | | functionView.funnameBtn.TextID = MyInternationalizationString.device; |
| | | middle.AddChidren(functionView.FunFrameView()); |
| | | functionView.clickviewBtn.MouseUpEventHandler += (sender, e) => |
| | | { |
| | | var roomAndDeviceView = new RoomAndDeviceView(); |
| | | UserView.HomePage.Instance.AddChidren(roomAndDeviceView); |
| | | UserView.HomePage.Instance.PageIndex += 1; |
| | | roomAndDeviceView.IfType = LogicView.IfString.Condition_Logic; |
| | | roomAndDeviceView.Show(Language.StringByID(MyInternationalizationString.devicestate)); |
| | | }; |
| | | |
| | | ///安防 |
| | | FunView securityView = new FunView(); |
| | | securityView.funFrameLayout.Y = functionView.funFrameLayout.Bottom; |
| | | securityView.iconBtn.UnSelectedImagePath = "ZigeeLogic/security.png"; |
| | | securityView.funnameBtn.TextID = MyInternationalizationString.security; |
| | | middle.AddChidren(securityView.FunFrameView()); |
| | | securityView.clickviewBtn.MouseUpEventHandler += (sender, e) => |
| | | { |
| | | //CurtainPanel.ButtonSet buttonSet = new CurtainPanel.ButtonSet(); |
| | | //UserView.HomePage.Instance.AddChidren(buttonSet); |
| | | //UserView.HomePage.Instance.PageIndex += 1; |
| | | //buttonSet.Show(); |
| | | //return; |
| | | var flMain = new FrameLayout { BackgroundColor = ZigbeeColor.Current.LogicViewBackgroundColor }; |
| | | this.AddChidren(flMain); |
| | | SecurityView(flMain, false); |
| | | }; |
| | | |
| | | ///地理围栏 |
| | | FunView positionView = new FunView(); |
| | | positionView.funFrameLayout.Y = securityView.funFrameLayout.Bottom; |
| | |
| | | positionView.funnameBtn.TextID = MyInternationalizationString.location; |
| | | positionView.lineBtn.BackgroundColor = ZigbeeColor.Current.LogicBlankBackgroundColor; |
| | | middle.AddChidren(positionView.FunFrameView()); |
| | | #endregion |
| | | |
| | | timeView.clickviewBtn.MouseUpEventHandler += (sender, e) => |
| | | { |
| | | TimeView(); |
| | | }; |
| | | functionView.clickviewBtn.MouseUpEventHandler += (sender, e) => |
| | | { |
| | | var roomAndDeviceView = new RoomAndDeviceView(); |
| | | UserView.HomePage.Instance.AddChidren(roomAndDeviceView); |
| | | UserView.HomePage.Instance.PageIndex += 1; |
| | | roomAndDeviceView.IfType = LogicView.IfString.Condition_Logic; |
| | | roomAndDeviceView.Show(Language.StringByID(MyInternationalizationString.devicestate)); |
| | | |
| | | }; |
| | | securityView.clickviewBtn.MouseUpEventHandler += (sender, e) => |
| | | { |
| | | var flMain = new FrameLayout { BackgroundColor = ZigbeeColor.Current.LogicViewBackgroundColor }; |
| | | this.AddChidren(flMain); |
| | | SecurityView(flMain, false); |
| | | }; |
| | | positionView.clickviewBtn.MouseUpEventHandler += (sender, e) => |
| | | { |
| | | var flMain = new FrameLayout { BackgroundColor = ZigbeeColor.Current.LogicViewBackgroundColor }; |
| | | this.AddChidren(flMain); |
| | | LocationView(flMain, false); |
| | | }; |
| | | |
| | | #endregion |
| | | |
| | | } |
| | | |
| | | /// <summary> |
| | |
| | | #endregion |
| | | string strname = ""; |
| | | //到达地点点击事件 |
| | | athomeView.clickviewBtn.MouseUpEventHandler += (sender, e) => { |
| | | athomeView.clickviewBtn.MouseUpEventHandler += (sender, e) =>
|
| | | { |
| | | |
| | | strname = athomeView.titleBtn.Text; |
| | | leaveView.titleBtn.TextColor = ZigbeeColor.Current.LogicBtnNotSelectedColor; |
| | |
| | | athomeView.selectedIconBtn.Visible = true; |
| | | }; |
| | | //离开地点点击事件 |
| | | leaveView.clickviewBtn.MouseUpEventHandler += (sender, e) => { |
| | | leaveView.clickviewBtn.MouseUpEventHandler += (sender, e) =>
|
| | | { |
| | | strname = leaveView.titleBtn.Text; |
| | | leaveView.titleBtn.TextColor = ZigbeeColor.Current.LogicBtnSelectedColor; |
| | | athomeView.titleBtn.TextColor = ZigbeeColor.Current.LogicBtnNotSelectedColor; |
| | | leaveView.selectedIconBtn.Visible = true; |
| | | athomeView.selectedIconBtn.Visible = false; |
| | | }; |
| | | |
| | | };
|
| | |
|
| | | double latitude = Config.Instance.Home.Latitude;//纬度 |
| | | double longitude = Config.Instance.Home.Longitude;//经度 |
| | | int r = 500;//半径 |
| | |
| | | LocationConditionsInfo.Remove("AtHome"); |
| | | } |
| | | LocationConditionsInfo.Add("AtHome", "1"); |
| | | } |
| | | |
| | | //调用方法,跳转页面 |
| | | GDMapKit.Show((mLatitude, mLongitude, mRadius, name) => |
| | | { |
| | | //截取字符串后第6位; |
| | | //var len = name.Substring(name.Length - 6, 6); |
| | | |
| | | //点击保存按钮,回调当前选择的纬度,经度,半径范围 |
| | | }
|
| | |
|
| | | #if Android
|
| | | //申请定位权限
|
| | | ((BaseActivity)Application.Activity).SetGPSLocationPermission((result1) =>
|
| | | {
|
| | | if (result1 == false) { return; }
|
| | |
|
| | | //申请允许程序写入外部存储,如SD卡上写文件
|
| | | ((BaseActivity)Application.Activity).SetPermission((result2) =>
|
| | | {
|
| | | if (result2 == false) { return; }
|
| | | //读取电话状态权限
|
| | | ((BaseActivity)Application.Activity).SetPermission((result3) =>
|
| | | {
|
| | | if (result3 == false) { return; }
|
| | |
|
| | | //调用方法,跳转页面
|
| | | GDMapKit.Show((mLatitude, mLongitude, mRadius, name) =>
|
| | | {
|
| | | //截取字符串后第6位;
|
| | | //var len = name.Substring(name.Length - 6, 6);
|
| | |
|
| | | //点击保存按钮,回调当前选择的纬度,经度,半径范围
|
| | | var latitudW = (int)Math.Truncate(mLatitude * 1000000);
|
| | | var longitudeH = (int)Math.Truncate(mLongitude * 1000000);
|
| | | Dictionary<string, string> accounts = new Dictionary<string, string>();
|
| | | if (accounts.ContainsKey("Account"))
|
| | | {
|
| | | accounts.Remove("Account");
|
| | | }
|
| | | if (accounts.ContainsKey("Type"))
|
| | | {
|
| | | accounts.Remove("Type");
|
| | | }
|
| | | if (accounts.ContainsKey("Latitude"))
|
| | | {
|
| | | accounts.Remove("latitude");
|
| | | }
|
| | | if (accounts.ContainsKey("Longitude"))
|
| | | {
|
| | | accounts.Remove("Longitude");
|
| | | }
|
| | | if (accounts.ContainsKey("Radius"))
|
| | | {
|
| | | accounts.Remove("radius");
|
| | | }
|
| | | accounts.Add("Account", Config.Instance.Guid);
|
| | | accounts.Add("Type", "7");
|
| | | accounts.Add("Latitude", latitudW.ToString());
|
| | | accounts.Add("Longitude", longitudeH.ToString());
|
| | | accounts.Add("Radius", mRadius.ToString());
|
| | |
|
| | | LogicIfon.Addaccounts(accounts);
|
| | | LogicIfon.AddLocationconditions(LocationConditionsInfo);
|
| | |
|
| | | var logicCommunalPage = new LogicCommunalPage();
|
| | | UserView.HomePage.Instance.AddChidren(logicCommunalPage);
|
| | | UserView.HomePage.Instance.PageIndex += 1;
|
| | | logicCommunalPage.Show(() => { });
|
| | | }, strname, Language.StringByID(R.MyInternationalizationString.uSave), true, latitude, longitude, r);
|
| | |
|
| | | }, "android.permission.READ_PHONE_STATE");
|
| | |
|
| | | }, "android.permission.WRITE_EXTERNAL_STORAGE");
|
| | | });
|
| | | #endif
|
| | | #if iOS
|
| | | //调用方法,跳转页面
|
| | | GDMapKit.Show((mLatitude, mLongitude, mRadius, name) =>
|
| | | {
|
| | | //截取字符串后第6位;
|
| | | //var len = name.Substring(name.Length - 6, 6);
|
| | |
|
| | | //点击保存按钮,回调当前选择的纬度,经度,半径范围
|
| | | var latitudW = (int)Math.Truncate(mLatitude * 1000000); |
| | | var longitudeH = (int)Math.Truncate(mLongitude * 1000000); |
| | | Dictionary<string, string> accounts = new Dictionary<string, string>(); |
| | |
| | | accounts.Add("Latitude", latitudW.ToString()); |
| | | accounts.Add("Longitude", longitudeH.ToString()); |
| | | accounts.Add("Radius", mRadius.ToString()); |
| | | |
| | | LogicIfon.Addaccounts(accounts); |
| | | LogicIfon.AddLocationconditions(LocationConditionsInfo); |
| | | |
| | | var logicCommunalPage = new LogicCommunalPage(); |
| | | UserView.HomePage.Instance.AddChidren(logicCommunalPage); |
| | | UserView.HomePage.Instance.PageIndex += 1; |
| | | logicCommunalPage.Show(() => { }); |
| | | }, strname, true, latitude, longitude, r); |
| | | }, strname, Language.StringByID(R.MyInternationalizationString.uSave), true, latitude, longitude, r);
|
| | | #endif
|
| | | }; |
| | | } |
| | | |
| | |
| | | /// </summary> |
| | | void TimeView() |
| | | { |
| | | |
| | | UserView.HomePage.Instance.ScrollEnabled = false; |
| | | Dictionary<string, string> SecurityConditionsInfo = new Dictionary<string, string>(); |
| | | #region ------界面布局部分 |
| | |
| | | }; |
| | | } |
| | | |
| | | |
| | | } |
| | | |
| | | } |